Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
Interaction::GenericHandler Class Reference
Inheritance diagram for Interaction::GenericHandler:
Visualization::InteractionHandler CodeReview::HReviewableItem Comments::HComment Comments::HCommentDiagram Comments::HCommentDiagramConnector Comments::HCommentDiagramShape Comments::HCommentFreeNode Comments::HCommentImage InformationScripting::HQuery Interaction::HActionPrompt Interaction::HArrowHandler Interaction::HComposite Interaction::HInfoNode Interaction::HList Interaction::HMovableItem Interaction::HPositionLayout Interaction::HPromptShell Interaction::HRootItem Interaction::HSceneHandlerItem Interaction::HText Interaction::HViewItem OOInteraction::HClass OOInteraction::HExpression OOInteraction::HFormalArgument OOInteraction::HMethod OOInteraction::HModule OOInteraction::HProject OOInteraction::HStatement VersionControlUI::HObjectPathCrumb

Public Types

using CommentCreationFunction = std::function< Model::Node *()>
 
enum  CursorMoveOrientation { NoOrientation , VerticalOrientation , HorizontalOrientation }
 

Public Member Functions

virtual void action (Visualization::Item *target, const QString &action)
 
ActionPromptactionPrompt ()
 
void addCommand (Command *command)
 
virtual void beforeEvent (Visualization::Item *target, QEvent *event) override
 
virtual void command (Visualization::Item *target, const QString &command, const std::unique_ptr< Visualization::Cursor > &cursor) override
 
const QList< Command * > & commands ()
 TODO: Commands are not inherited when the handler is inherited. More...
 
virtual void focusInEvent (Visualization::Item *target, QFocusEvent *event) override
 
virtual void keyPressEvent (Visualization::Item *target, QKeyEvent *event) override
 
virtual void mouseDoubleClickEvent (Visualization::Item *target, QGraphicsSceneMouseEvent *event) override
 
virtual void mouseMoveEvent (Visualization::Item *target, QGraphicsSceneMouseEvent *event) override
 
virtual void mousePressEvent (Visualization::Item *target, QGraphicsSceneMouseEvent *event) override
 
virtual void mouseReleaseEvent (Visualization::Item *target, QGraphicsSceneMouseEvent *event) override
 
void removeActionPrompt ()
 
bool removeFromList (Visualization::Item *target)
 Removes the node visualized by target from the list which contains it. More...
 
void showActionPrompt (Visualization::Item *actionRecevier, bool autoExecuteAction)
 
void toggleComment (Visualization::Item *itemWithComment, Model::Node *aNode, bool hideOnly)
 
virtual void wheelEvent (Visualization::Item *target, QGraphicsSceneWheelEvent *event) override
 
- Public Member Functions inherited from Visualization::InteractionHandler
virtual ~InteractionHandler ()
 
virtual void afterEvent (Item *target, QEvent *event)
 
virtual void command (Item *target, const QString &command, const std::unique_ptr< Cursor > &cursor)
 
virtual void contextMenuEvent (Item *target, QGraphicsSceneContextMenuEvent *event)
 
virtual void dragEnterEvent (Item *target, QGraphicsSceneDragDropEvent *event)
 
virtual void dragLeaveEvent (Item *target, QGraphicsSceneDragDropEvent *event)
 
virtual void dragMoveEvent (Item *target, QGraphicsSceneDragDropEvent *event)
 
virtual void dropEvent (Item *target, QGraphicsSceneDragDropEvent *event)
 
virtual void focusOutEvent (Item *target, QFocusEvent *event)
 
virtual void hoverEnterEvent (Item *target, QGraphicsSceneHoverEvent *event)
 
virtual void hoverLeaveEvent (Item *target, QGraphicsSceneHoverEvent *event)
 
virtual void hoverMoveEvent (Item *target, QGraphicsSceneHoverEvent *event)
 
virtual void keyReleaseEvent (Item *target, QKeyEvent *event)
 

Static Public Member Functions

static CommandExecutionEngineexecutionEngine ()
 
static void fixCursorPositionForUndoAfterTreeManagerChange ()
 
static GenericHandlerinstance ()
 
static void setCommandExecutionEngine (CommandExecutionEngine *engine)
 
static void setCommentCreationFunction (CommentCreationFunction f)
 
- Static Public Member Functions inherited from Visualization::InteractionHandler
static InteractionHandlerinstance ()
 
static bool isClick (Item *target)
 
static bool isDrag (Item *target)
 

Protected Member Functions

 GenericHandler ()
 
virtual void filterSelectedItems (Visualization::Item *target, QGraphicsSceneMouseEvent *event)
 
bool moveCursor (Visualization::Item *target, int key)
 
- Protected Member Functions inherited from Visualization::InteractionHandler
 InteractionHandler ()
 

Static Private Member Functions

static GenericHandlerManagerListenermanagerListener ()
 
static void recordCursorPosition (Visualization::Item *target)
 
static void resetCursorOrigin ()
 

Private Attributes

QList< Command * > supportedCommands
 

Static Private Attributes

static ActionPromptactionPrompt_ {}
 
static CommentCreationFunction createComment_ {}
 
static CursorMoveOrientation cursorMoveOrientation_ = NoOrientation
 
static QRect cursorOrigin_
 
static QList< QPair< Visualization::Item *, QPoint > > cursorPositionsForUndo_ {}
 
static int cursorUndoIndex_ {-1}
 
static CommandExecutionEngineexecutionEngine_ = CommandExecutionEngine::instance()
 
static QHash< int, QPoint > keyToViewItemIndexMap_
 
static QPair< Visualization::Item *, QPoint > lastCursorPosition_
 

Member Typedef Documentation

◆ CommentCreationFunction

Member Enumeration Documentation

◆ CursorMoveOrientation

Enumerator
NoOrientation 
VerticalOrientation 
HorizontalOrientation 

Constructor & Destructor Documentation

◆ GenericHandler()

Interaction::GenericHandler::GenericHandler ( )
protected

Member Function Documentation

◆ action()

void Interaction::GenericHandler::action ( Visualization::Item target,
const QString &  action 
)
virtual

◆ actionPrompt()

ActionPrompt * Interaction::GenericHandler::actionPrompt ( )

◆ addCommand()

void Interaction::GenericHandler::addCommand ( Command command)
inline

◆ beforeEvent()

void Interaction::GenericHandler::beforeEvent ( Visualization::Item target,
QEvent *  event 
)
overridevirtual

Reimplemented from Visualization::InteractionHandler.

◆ command()

void Interaction::GenericHandler::command ( Visualization::Item target,
const QString &  command,
const std::unique_ptr< Visualization::Cursor > &  cursor 
)
overridevirtual

◆ commands()

const QList< Command * > & Interaction::GenericHandler::commands ( )
inline

TODO: Commands are not inherited when the handler is inherited.

Is this right?

◆ executionEngine()

CommandExecutionEngine * Interaction::GenericHandler::executionEngine ( )
static

◆ filterSelectedItems()

void Interaction::GenericHandler::filterSelectedItems ( Visualization::Item target,
QGraphicsSceneMouseEvent *  event 
)
protectedvirtual

◆ fixCursorPositionForUndoAfterTreeManagerChange()

void Interaction::GenericHandler::fixCursorPositionForUndoAfterTreeManagerChange ( )
static

◆ focusInEvent()

void Interaction::GenericHandler::focusInEvent ( Visualization::Item target,
QFocusEvent *  event 
)
overridevirtual

Reimplemented from Visualization::InteractionHandler.

◆ instance()

GenericHandler * Interaction::GenericHandler::instance ( )
static

◆ keyPressEvent()

void Interaction::GenericHandler::keyPressEvent ( Visualization::Item target,
QKeyEvent *  event 
)
overridevirtual

◆ managerListener()

GenericHandlerManagerListener & Interaction::GenericHandler::managerListener ( )
staticprivate

◆ mouseDoubleClickEvent()

void Interaction::GenericHandler::mouseDoubleClickEvent ( Visualization::Item target,
QGraphicsSceneMouseEvent *  event 
)
overridevirtual

◆ mouseMoveEvent()

void Interaction::GenericHandler::mouseMoveEvent ( Visualization::Item target,
QGraphicsSceneMouseEvent *  event 
)
overridevirtual

◆ mousePressEvent()

void Interaction::GenericHandler::mousePressEvent ( Visualization::Item target,
QGraphicsSceneMouseEvent *  event 
)
overridevirtual

◆ mouseReleaseEvent()

void Interaction::GenericHandler::mouseReleaseEvent ( Visualization::Item target,
QGraphicsSceneMouseEvent *  event 
)
overridevirtual

◆ moveCursor()

bool Interaction::GenericHandler::moveCursor ( Visualization::Item target,
int  key 
)
protected

◆ recordCursorPosition()

void Interaction::GenericHandler::recordCursorPosition ( Visualization::Item target)
staticprivate

◆ removeActionPrompt()

void Interaction::GenericHandler::removeActionPrompt ( )

◆ removeFromList()

bool Interaction::GenericHandler::removeFromList ( Visualization::Item target)

Removes the node visualized by target from the list which contains it.

Returns true if target has a parent of type VList and its list node contains the target node. Otherwise this method does nothing and returns false.

◆ resetCursorOrigin()

void Interaction::GenericHandler::resetCursorOrigin ( )
staticprivate

◆ setCommandExecutionEngine()

void Interaction::GenericHandler::setCommandExecutionEngine ( CommandExecutionEngine engine)
static

◆ setCommentCreationFunction()

void Interaction::GenericHandler::setCommentCreationFunction ( CommentCreationFunction  f)
inlinestatic

◆ showActionPrompt()

void Interaction::GenericHandler::showActionPrompt ( Visualization::Item actionRecevier,
bool  autoExecuteAction 
)

◆ toggleComment()

void Interaction::GenericHandler::toggleComment ( Visualization::Item itemWithComment,
Model::Node aNode,
bool  hideOnly 
)

◆ wheelEvent()

void Interaction::GenericHandler::wheelEvent ( Visualization::Item target,
QGraphicsSceneWheelEvent *  event 
)
overridevirtual

Reimplemented from Visualization::InteractionHandler.

Member Data Documentation

◆ actionPrompt_

ActionPrompt * Interaction::GenericHandler::actionPrompt_ {}
staticprivate

◆ createComment_

GenericHandler::CommentCreationFunction Interaction::GenericHandler::createComment_ {}
staticprivate

◆ cursorMoveOrientation_

GenericHandler::CursorMoveOrientation Interaction::GenericHandler::cursorMoveOrientation_ = NoOrientation
staticprivate

◆ cursorOrigin_

QRect Interaction::GenericHandler::cursorOrigin_
staticprivate

◆ cursorPositionsForUndo_

QList< QPair< Visualization::Item *, QPoint > > Interaction::GenericHandler::cursorPositionsForUndo_ {}
staticprivate

◆ cursorUndoIndex_

int Interaction::GenericHandler::cursorUndoIndex_ {-1}
staticprivate

◆ executionEngine_

CommandExecutionEngine * Interaction::GenericHandler::executionEngine_ = CommandExecutionEngine::instance()
staticprivate

◆ keyToViewItemIndexMap_

QHash< int, QPoint > Interaction::GenericHandler::keyToViewItemIndexMap_
staticprivate
Initial value:
{{Qt::Key_1, QPoint{0, 0}}, {Qt::Key_2, QPoint{1, 0}}, {Qt::Key_3, QPoint{2, 0}},
{Qt::Key_4, QPoint{0, 1}}, {Qt::Key_5, QPoint{1, 1}}, {Qt::Key_6, QPoint{2, 1}},
{Qt::Key_7, QPoint{0, 2}}, {Qt::Key_8, QPoint{1, 2}}, {Qt::Key_9, QPoint{2, 2}}}

◆ lastCursorPosition_

QPair< Visualization::Item *, QPoint > Interaction::GenericHandler::lastCursorPosition_
staticprivate

◆ supportedCommands

QList<Command*> Interaction::GenericHandler::supportedCommands
private