myDelPntItem = mySketchPopup->insertItem(tr("MSG_DEL_LAST_PNT"), this, SLOT(deletePoint()));
mySketchPopup->insertItem(tr("MSG_DEL_LINK"), this, SLOT(cancelSketch()));
myOrtoItem = mySketchPopup->insertItem(tr("MSG_ORTHO_LINE"), this, SLOT(setOrthoMode()));
+
+
+ // add "change dataflow parameters" popup item
+ myPopup->insertSeparator();
+ myDSParamsItem = myPopup->insertItem( tr( "MSG_SET_GRAPHPARAMS" ), myMain, SLOT( changeDSGraphParameters() ) );
}
// Paste Node functionality
SUPERVGUI_Clipboard* aCB = SUPERVGUI_Clipboard::getClipboard();
myPopup->setItemEnabled(myPasteNodeItem, aCB->isCopyNode() );
+
+ myPopup->setItemEnabled( myDSParamsItem, isHavingStreamPort()/*myMain->getDataflow()->IsStreamGraph()*/ );
+
myMain->showPopup(myPopup, theEvent);
return;
}
myCursor = cursor();
setCursor(handCursor);
}
+
+bool SUPERVGUI_CanvasView::isHavingStreamPort() const
+{
+ SUPERV::ListOfNodes* aNodesList = myMain->getDataflow()->Nodes();
+
+ //Computing Nodes
+ for ( int i = 0 ; i < (int) aNodesList->CNodes.length() ; i++ ) {
+ SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->CNodes)[i]->StreamPorts() );
+ if ((int) aStrPortsList.length() > 0) {
+ return true;
+ }
+ }
+
+ //FactoryNodes
+ for ( int i = 0 ; i < (int) aNodesList->FNodes.length() ; i++ ) {
+ SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->FNodes)[i]->StreamPorts() );
+ if ((int) aStrPortsList.length() > 0) {
+ return true;
+ }
+ }
+
+ //InLineNodes
+ for ( int i = 0 ; i < (int) aNodesList->INodes.length() ; i++ ) {
+ SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->INodes)[i]->StreamPorts() );
+ if ((int) aStrPortsList.length() > 0) {
+ return true;
+ }
+ }
+
+ //GOTONodes
+ for ( int i = 0 ; i < (int) aNodesList->GNodes.length() ; i++ ) {
+ SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->GNodes)[i]->StreamPorts() );
+ if ((int) aStrPortsList.length() > 0) {
+ return true;
+ }
+ }
+
+ //LoopNodes
+ for ( int i = 0 ; i < (int) aNodesList->LNodes.length() ; i++ ) {
+ SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->LNodes)[i]->StreamPorts() );
+ if ((int) aStrPortsList.length() > 0) {
+ return true;
+ }
+ }
+
+ //SwitchNodes
+ for ( int i = 0 ; i < (int) aNodesList->SNodes.length() ; i++ ) {
+ SUPERV::ListOfStreamPorts aStrPortsList = *( (aNodesList->SNodes)[i]->StreamPorts() );
+ if ((int) aStrPortsList.length() > 0) {
+ return true;
+ }
+ }
+
+ return false;
+}