@@ -58,6 +58,7 @@ LineAnnotation::LineAnnotation(QString annotation, GraphicsView *pGraphicsView)
5858 setZfr (" " );
5959 setAlpha (" " );
6060 setOMSConnectionType (oms3_connection_single);
61+ setActiveState (false );
6162 // set the default values
6263 GraphicItem::setDefaults ();
6364 ShapeAnnotation::setDefaults ();
@@ -87,6 +88,7 @@ LineAnnotation::LineAnnotation(ShapeAnnotation *pShapeAnnotation, Component *pPa
8788 setZfr (" " );
8889 setAlpha (" " );
8990 setOMSConnectionType (oms3_connection_single);
91+ setActiveState (false );
9092 setPos (mOrigin );
9193 setRotation (mRotation );
9294 connect (pShapeAnnotation, SIGNAL (updateReferenceShapes ()), pShapeAnnotation, SIGNAL (changed ()));
@@ -125,6 +127,7 @@ LineAnnotation::LineAnnotation(LineAnnotation::LineType lineType, Component *pSt
125127 setSynchronize (false );
126128 setPriority (1 );
127129 setOMSConnectionType (oms3_connection_single);
130+ setActiveState (false );
128131 if (mLineType == LineAnnotation::ConnectionType) {
129132 /* Use the linecolor of the first shape from icon layer of start component for the connection line.
130133 * Or use black color if there is no shape in the icon layer
@@ -210,6 +213,7 @@ LineAnnotation::LineAnnotation(QString annotation, Component *pStartComponent, C
210213 setZfr (" " );
211214 setAlpha (" " );
212215 setOMSConnectionType (oms3_connection_single);
216+ setActiveState (false );
213217 parseShapeAnnotation (annotation);
214218 /* make the points relative to origin */
215219 QList<QPointF> points;
@@ -248,6 +252,7 @@ LineAnnotation::LineAnnotation(QString annotation, QString text, Component *pSta
248252 setZfr (" " );
249253 setAlpha (" " );
250254 setOMSConnectionType (oms3_connection_single);
255+ setActiveState (false );
251256 parseShapeAnnotation (annotation);
252257 /* make the points relative to origin */
253258 QList<QPointF> points;
@@ -287,6 +292,7 @@ LineAnnotation::LineAnnotation(QString annotation, Component *pComponent, Graphi
287292 setZfr (" " );
288293 setAlpha (" " );
289294 setOMSConnectionType (oms3_connection_single);
295+ setActiveState (false );
290296 parseShapeAnnotation (annotation);
291297 /* make the points relative to origin */
292298 QList<QPointF> points;
@@ -318,6 +324,7 @@ LineAnnotation::LineAnnotation(Component *pParent)
318324 setZfr (" " );
319325 setAlpha (" " );
320326 setOMSConnectionType (oms3_connection_single);
327+ setActiveState (false );
321328 // set the default values
322329 GraphicItem::setDefaults ();
323330 ShapeAnnotation::setDefaults ();
@@ -354,6 +361,7 @@ LineAnnotation::LineAnnotation(GraphicsView *pGraphicsView)
354361 setZfr (" " );
355362 setAlpha (" " );
356363 setOMSConnectionType (oms3_connection_single);
364+ setActiveState (false );
357365 // set the default values
358366 GraphicItem::setDefaults ();
359367 ShapeAnnotation::setDefaults ();
@@ -467,6 +475,13 @@ void LineAnnotation::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
467475 Q_UNUSED (option);
468476 Q_UNUSED (widget);
469477 if (mVisible || !mDynamicVisible .isEmpty ()) {
478+ if (mLineType == LineAnnotation::TransitionType && mpGraphicsView->isVisualizationView ()) {
479+ if (isActiveState ()) {
480+ painter->setOpacity (1.0 );
481+ } else {
482+ painter->setOpacity (0.2 );
483+ }
484+ }
470485 drawLineAnnotaion (painter);
471486 }
472487}
@@ -1019,20 +1034,27 @@ void LineAnnotation::updateShape(ShapeAnnotation *pShapeAnnotation)
10191034 setReset (pLineAnnotation->getReset ());
10201035 setSynchronize (pLineAnnotation->getSynchronize ());
10211036 setPriority (pLineAnnotation->getPriority ());
1022- mpTextAnnotation = pLineAnnotation->getTextAnnotation ();
1037+ if (pLineAnnotation->getTextAnnotation ()) {
1038+ mpTextAnnotation = new TextAnnotation (" " , this );
1039+ mpTextAnnotation->updateShape (pLineAnnotation->getTextAnnotation ());
1040+ } else {
1041+ mpTextAnnotation = 0 ;
1042+ }
10231043 setOldAnnotation (pLineAnnotation->getOldAnnotation ());
10241044 setDelay (pLineAnnotation->getDelay ());
10251045 setZf (pLineAnnotation->getZf ());
10261046 setZfr (pLineAnnotation->getZfr ());
10271047 setAlpha (pLineAnnotation->getAlpha ());
10281048 setOMSConnectionType (pLineAnnotation->getOMSConnectionType ());
1049+ setActiveState (pLineAnnotation->isActiveState ());
10291050 // set the default values
10301051 GraphicItem::setDefaults (pShapeAnnotation);
10311052 mPoints .clear ();
10321053 QList<QPointF> points = pShapeAnnotation->getPoints ();
10331054 for (int i = 0 ; i < points.size () ; i++) {
10341055 addPoint (points[i]);
10351056 }
1057+ updateTransitionTextPosition ();
10361058 ShapeAnnotation::setDefaults (pShapeAnnotation);
10371059}
10381060
@@ -1093,6 +1115,22 @@ void LineAnnotation::showOMSConnection()
10931115 }
10941116}
10951117
1118+ void LineAnnotation::updateToolTip ()
1119+ {
1120+ if (mLineType == LineAnnotation::ConnectionType) {
1121+ setToolTip (QString (" <b>connect</b>(%1, %2)" ).arg (getStartComponentName ()).arg (getEndComponentName ()));
1122+ } else if (mLineType == LineAnnotation::TransitionType) {
1123+ setToolTip (QString (" <b>transition</b>(%1, %2, %3, %4, %5, %6, %7)" )
1124+ .arg (getStartComponentName ())
1125+ .arg (getEndComponentName ())
1126+ .arg (getCondition ())
1127+ .arg (getImmediate () ? " true" : " false" )
1128+ .arg (getReset () ? " true" : " false" )
1129+ .arg (getSynchronize () ? " true" : " false" )
1130+ .arg (getPriority ()));
1131+ }
1132+ }
1133+
10961134QVariant LineAnnotation::itemChange (GraphicsItemChange change, const QVariant &value)
10971135{
10981136 ShapeAnnotation::itemChange (change, value);
@@ -2076,6 +2114,9 @@ CreateOrEditTransitionDialog::CreateOrEditTransitionDialog(GraphicsView *pGraphi
20762114 // Create the buttons
20772115 mpOkButton = new QPushButton (Helper::ok);
20782116 mpOkButton->setAutoDefault (true );
2117+ if (mpGraphicsView->getModelWidget ()->getLibraryTreeItem ()->isSystemLibrary () || mpGraphicsView->isVisualizationView ()) {
2118+ mpOkButton->setDisabled (true );
2119+ }
20792120 connect (mpOkButton, SIGNAL (clicked ()), SLOT (createOrEditTransition ()));
20802121 mpCancelButton = new QPushButton (Helper::cancel);
20812122 mpCancelButton->setAutoDefault (false );
0 commit comments