• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

C:/CVUT/diplomka/Automata_editor/sources/twoStatesTransition.cpp

Go to the documentation of this file.
00001 #include "constants.h"
00002 
00003 #include "twoStatesTransition.h"
00004 #include "state.h"
00005 
00006 #include <QGraphicsSceneMouseEvent>
00007 #include <QtDebug>
00008 
00009 void TwoStatesTransition::paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
00010 {
00011     if (startPoint == endPoint) return;
00012     Transition::paint(painter, option, widget);
00013 }
00014 
00015 void TwoStatesTransition::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
00016 {
00017     DBGLOG_ME(event->button());
00018     if (m_lastMouseClickType == eMouseRightClick)
00019     {
00020         editor->showPopup(this, mapToScene(event->pos().toPoint()));
00021         return; // could be deleted!
00022     }
00023     else if (m_lastMouseClickType == eMouseDoubleClick)
00024     {
00025         editor->editTransition(this);
00026         return; // could be deleted when type is changed!
00027     }
00028     setChecked(false);
00029 }
00030 
00031 void TwoStatesTransition::assign()
00032 {
00033     startState->addTransition(this);
00034     endState->addTransition(this);
00035 }
00036 
00037 void TwoStatesTransition::unassign()
00038 {
00039     startState->removeTransition(this);
00040     endState->removeTransition(this);
00041 }
00042 
00043 void TwoStatesTransition::setLeftOriented(bool leftO)
00044 {
00045     leftOriented = leftO;
00046     adjust();
00047 }
00048 
00049 bool TwoStatesTransition::isLeftOriented()
00050 {
00051     return leftOriented;
00052 }

Generated on Tue Jan 4 2011 03:03:24 for Autoamata editor by  doxygen 1.7.0