#include "SUPERVGUI_DataModel.h"
#include "SUPERVGUI_Selection.h"
+
#include "SALOMEDSClient.hxx"
#include <boost/shared_ptr.hpp>
using namespace boost;
#include "SUIT_Study.h"
#include "SUPERVGraph_ViewManager.h"
+#include "SUPERVGraph_ViewFrame.h"
#include "SALOME_ListIO.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
SUIT_ViewWindow* SUPERVGUI::createGraph() {
SUPERVGraph_ViewManager* aVM = new SUPERVGraph_ViewManager( study, application()->desktop(), new SUPERVGraph_Viewer() );
(( SalomeApp_Application* )application())->addViewManager( aVM );
- SUIT_ViewWindow* aVW = aVM->createViewWindow();
+ SUPERVGraph_ViewFrame* aVW = dynamic_cast<SUPERVGraph_ViewFrame*>( aVM->createViewWindow() );
if ( aVW ) {
+ QColor back = getApp()->resourceMgr()->colorValue( "SUPERVGraph", "Background", aVW->backgroundColor() );
+ qDebug( QString( "background: %1 %2 %3" ).arg( back.red() ).arg( back.green() ).arg( back.blue() ) );
+ aVW->setBackgroundColor( back );
connect( aVM,
SIGNAL( deleteView( SUIT_ViewWindow* ) ),
this,
#include "SUPERVGUI_Main.h"
#include "SalomeApp_Module.h"
+#include "SALOMEDSClient.hxx"
class SUIT_Study;
*/
-SUPERVGUI_Canvas::SUPERVGUI_Canvas(SUPERVGUI_Main* m):
+SUPERVGUI_Canvas::SUPERVGUI_Canvas( SUPERVGUI_Main* m, SUIT_ResourceMgr* mgr ):
QCanvas(),
myMain(m)
{
resize(1050, 750);
setDoubleBuffering(true);
- QColor aColor(MAIN_COLOR);
+ QColor aColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
//aColor = QColor(SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorRed" ),
// SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorGreen" ),
// SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorBlue" ) );
class SUPERVGUI_CanvasNode;
class SUPERVGUI_CanvasPort;
class SUPERVGUI_CanvasLink;
+class SUIT_ResourceMgr;
class SUPERVGUI_Canvas: public QCanvas {
Q_OBJECT
Rtti_Hook = 13
};
- SUPERVGUI_Canvas(SUPERVGUI_Main* m);
+ SUPERVGUI_Canvas( SUPERVGUI_Main* m, SUIT_ResourceMgr* );
virtual ~SUPERVGUI_Canvas();
void merge();
else x += (CELL_WIDTH + CELL_SPACE); \
cell = getCellNode(aCNode); \
if (cell == NULL) { \
- SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(this, myMain, aCNode); \
+ SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(myMgr, this, myMain, aCNode); \
aNode->move(x, y); \
aNode->show(); \
aNode->sync(); \
SUPERV_CNode aCNodeEnd = SUPERV::CNode::_narrow(nodes->NodesName[co]->Coupled()); \
cell = getCellNode(aCNode); \
if (cell == NULL) { \
- SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode(this, myMain, aCNode); \
+ SUPERVGUI_CanvasCellNode* aNode = new SUPERVGUI_CanvasCellNode( myMgr, this, myMain, aCNode); \
aNode->move(x, y); \
aNode->show(); \
aNode->sync(); \
y += (CELL_HEIGHT + CELL_SPACE); \
- SUPERVGUI_CanvasCellNode* aNodeEnd = new SUPERVGUI_CanvasCellEndNode(this, myMain, aCNodeEnd, aNode); \
+ SUPERVGUI_CanvasCellNode* aNodeEnd = new SUPERVGUI_CanvasCellEndNode( myMgr, this, myMain, aCNodeEnd, aNode); \
aNodeEnd->move(x, y); \
aNodeEnd->show(); \
aNodeEnd->sync(); \
// SUPERVGUI_Array on QCanvas
// ----------------------------------------------------------
-SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray(SUPERVGUI_Main* m):
+SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray(SUPERVGUI_Main* m, SUIT_ResourceMgr* mgr ):
QCanvas(),
- myMain(m)
+ myMain(m),
+ myMgr( mgr )
{
Trace("SUPERVGUI_CanvasArray::SUPERVGUI_CanvasArray");
//resize(GRAPH_WIDTH, GRAPH_HEIGHT);
resize(1000, 725);
setDoubleBuffering(true);
- QColor aColor(MAIN_COLOR);
+ QColor aColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_COLOR );
//aColor = QColor(SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorRed" ),
// SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorGreen" ),
// SUIT_Session::session()->resourceMgr()->integerValue( "SUPERVGraph", "BackgroundColorBlue" ) );
QPen pen(Qt::SolidLine);
pen.setWidth(1);
- QBrush br(MAIN_TITLE);
+
+ QBrush br( myMgr->colorValue( "SUPERVGraph", "Title", DEF_MAIN_TITLE ) );
// variables to resize canvas in table view
int aMaxWidth = 0;
SUPERVGUI_CanvasCellNode* SUPERVGUI_CanvasArray::addNode(SUPERV_CNode node) {
Trace("SUPERVGUI_CanvasArray::addNode");
- SUPERVGUI_CanvasCellNode* n = new SUPERVGUI_CanvasCellNode(this, myMain, node);
+ SUPERVGUI_CanvasCellNode* n = new SUPERVGUI_CanvasCellNode( myMgr, this, myMain, node);
n->move(nodeX, nodeY);
n->show();
update();
#include <qpopupmenu.h>
#include <qcanvas.h>
+class SUIT_ResourceMgr;
class SUPERVGUI_Main;
class SUPERVGUI_CanvasArray: public QCanvas {
Q_OBJECT
public:
- SUPERVGUI_CanvasArray(SUPERVGUI_Main* m);
+ SUPERVGUI_CanvasArray(SUPERVGUI_Main* m, SUIT_ResourceMgr* );
virtual ~SUPERVGUI_CanvasArray();
void sync();
private:
SUPERVGUI_Main* myMain;
+ SUIT_ResourceMgr* myMgr;
int nodeX;
int nodeY;
#include "SUPERVGUI_CanvasCellNodePrs.h"
#include "SUPERVGUI_Canvas.h"
+#include "SUIT_ResourceMgr.h"
+
#define TEXT_MARGIN 5
// ----------------------------------------------------------
// Cell widget of the table on QCanvas
// ----------------------------------------------------------
-SUPERVGUI_CanvasCellNodePrs::SUPERVGUI_CanvasCellNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasCellNode* theNode):
+SUPERVGUI_CanvasCellNodePrs::SUPERVGUI_CanvasCellNodePrs( SUIT_ResourceMgr* mgr, QCanvas* theCanvas, SUPERVGUI_CanvasCellNode* theNode):
myTitleWidth(CELL_WIDTH_PART),
myLabelWidth(CELL_WIDTH_PART),
myStatusWidth(CELL_WIDTH_PART),
- SUPERVGUI_CanvasNodePrs(theCanvas, theNode, true)
+ SUPERVGUI_CanvasNodePrs( mgr, theCanvas, theNode, true)
{
myPortVisible = false;
}
else if (getNode()->getEngine()->IsGOTO())
thePainter.setBrush(Qt::green.light());
else {
- QBrush br(MAIN_TITLE);
+ QBrush br( resMgr()->colorValue( "SUPERVGraph", "Title", DEF_MAIN_TITLE ) );
thePainter.setBrush(br);
}
drawTitleShape(thePainter);
default:
setStatus("No Status");
- setStatusColor(MAIN_BACK);
+ setStatusColor( resMgr()->colorValue( "SUPERVGraph", "Background", DEF_MAIN_BACK ) );
break;
}
class SUPERVGUI_CanvasCellNodePrs: public SUPERVGUI_CanvasNodePrs {
public:
- SUPERVGUI_CanvasCellNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasCellNode* theNode);
+ SUPERVGUI_CanvasCellNodePrs( SUIT_ResourceMgr*, QCanvas* theCanvas, SUPERVGUI_CanvasCellNode* theNode);
virtual ~SUPERVGUI_CanvasCellNodePrs();
virtual void moveBy(double dx, double dy);
//=====================================================================
// Compute node
//=====================================================================
-SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
- SUPERVGUI_CanvasNode(theParent, theMain, theNode)
+SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode( SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+ SUPERVGUI_CanvasNode( mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasComputeNode::SUPERVGUI_CanvasComputeNode");
}
//=====================================================================
// Start control node
//=====================================================================
-SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
- SUPERVGUI_CanvasNode(theParent, theMain, theNode),
+SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+ SUPERVGUI_CanvasNode( mgr, theParent, theMain, theNode),
myCoupled(0)
{
Trace("SUPERVGUI_CanvasStartNode::SUPERVGUI_CanvasStartNode");
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasStartNode::createPrs() const
{
- return new SUPERVGUI_CanvasStartNodePrs(getMain()->getCanvas(),
- (SUPERVGUI_CanvasStartNode*)this);
+ return new SUPERVGUI_CanvasStartNodePrs( resMgr(), getMain()->getCanvas(),
+ (SUPERVGUI_CanvasStartNode*)this);
}
bool SUPERVGUI_CanvasStartNode::setNodeName(QString aName)
//=====================================================================
// End control node
//=====================================================================
-SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
- SUPERVGUI_CanvasStartNode* theStart):
- SUPERVGUI_CanvasNode(theParent, theMain, theNode),
+SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode, SUPERVGUI_CanvasStartNode* theStart):
+ SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode),
myCoupled(theStart)
{
Trace("SUPERVGUI_CanvasEndNode::SUPERVGUI_CanvasEndNode");
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasEndNode::createPrs() const
{
- return new SUPERVGUI_CanvasEndNodePrs(getMain()->getCanvas(),
- (SUPERVGUI_CanvasEndNode*)this);
+ return new SUPERVGUI_CanvasEndNodePrs( resMgr(), getMain()->getCanvas(),
+ (SUPERVGUI_CanvasEndNode*)this);
}
QPopupMenu* SUPERVGUI_CanvasEndNode::getPopupMenu(QWidget* theParent)
//=====================================================================
// Goto control node
//=====================================================================
-SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
- SUPERVGUI_CanvasNode(theParent, theMain, theNode)
+SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+ SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasGotoNode::SUPERVGUI_CanvasGotoNode");
}
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasGotoNode::createPrs() const
{
- return new SUPERVGUI_CanvasGotoNodePrs(getMain()->getCanvas(),
- (SUPERVGUI_CanvasGotoNode*)this);
+ return new SUPERVGUI_CanvasGotoNodePrs( resMgr(), getMain()->getCanvas(),
+ (SUPERVGUI_CanvasGotoNode*)this);
}
QPopupMenu* SUPERVGUI_CanvasGotoNode::getPopupMenu(QWidget* theParent)
//=====================================================================
// Macro node
//=====================================================================
-SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
- SUPERVGUI_CanvasComputeNode(theParent, theMain, theNode)
+SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode(SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode):
+ SUPERVGUI_CanvasComputeNode(mgr, theParent, theMain, theNode)
{
Trace("SUPERVGUI_CanvasMacroNode::SUPERVGUI_CanvasMacroNode");
}
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasMacroNode::createPrs() const
{
- return new SUPERVGUI_CanvasMacroNodePrs(getMain()->getCanvas(),
- (SUPERVGUI_CanvasMacroNode*)this);
+ return new SUPERVGUI_CanvasMacroNodePrs( resMgr(), getMain()->getCanvas(),
+ (SUPERVGUI_CanvasMacroNode*)this);
}
QPopupMenu* SUPERVGUI_CanvasMacroNode::getPopupMenu(QWidget* theParent)
//=====================================================================
// Cell node: node for table view
//=====================================================================
-SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode(QObject* theParent,
+SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode(SUIT_ResourceMgr* mgr, QObject* theParent,
SUPERVGUI_Main* theMain,
SUPERV_CNode theNode):
- SUPERVGUI_CanvasNode(theParent, theMain, theNode, true)
+ SUPERVGUI_CanvasNode(mgr, theParent, theMain, theNode, true)
{
Trace("SUPERVGUI_CanvasCellNode::SUPERVGUI_CanvasCellNode");
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasCellNode::createPrs() const
{
SUPERVGUI_CanvasNodePrs* aPrs =
- new SUPERVGUI_CanvasCellNodePrs(getMain()->getCanvasArray(),
- (SUPERVGUI_CanvasCellNode*)this);
+ new SUPERVGUI_CanvasCellNodePrs( resMgr(), getMain()->getCanvasArray(),
+ (SUPERVGUI_CanvasCellNode*)this);
return aPrs;
}
-SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode( QObject* theParent,
+SUPERVGUI_CanvasCellEndNode::SUPERVGUI_CanvasCellEndNode( SUIT_ResourceMgr* mgr, QObject* theParent,
SUPERVGUI_Main* theMain,
SUPERV_CNode theNode,
SUPERVGUI_CanvasCellNode* theStart):
- SUPERVGUI_CanvasCellNode(theParent, theMain, theNode)
+ SUPERVGUI_CanvasCellNode(mgr, theParent, theMain, theNode)
{
//set start cell for end cell as pair
myPairCell = theStart;
Q_OBJECT
public:
- SUPERVGUI_CanvasComputeNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+ SUPERVGUI_CanvasComputeNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
virtual ~SUPERVGUI_CanvasComputeNode() {}
virtual QPopupMenu* getPopupMenu(QWidget* theParent);
Q_OBJECT
public:
- SUPERVGUI_CanvasMacroNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+ SUPERVGUI_CanvasMacroNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
virtual ~SUPERVGUI_CanvasMacroNode() {}
virtual QPopupMenu* getPopupMenu(QWidget* theParent);
Q_OBJECT
public:
- SUPERVGUI_CanvasStartNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+ SUPERVGUI_CanvasStartNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
virtual ~SUPERVGUI_CanvasStartNode() {}
virtual bool setNodeName(QString aName);
Q_OBJECT
public:
- SUPERVGUI_CanvasEndNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
- SUPERVGUI_CanvasStartNode* theStart);
+ SUPERVGUI_CanvasEndNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode,
+ SUPERVGUI_CanvasStartNode* theStart);
virtual ~SUPERVGUI_CanvasEndNode() {}
SUPERVGUI_CanvasStartNode* getCoupled() const { return myCoupled; }
Q_OBJECT
public:
- SUPERVGUI_CanvasGotoNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
+ SUPERVGUI_CanvasGotoNode( SUIT_ResourceMgr*, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode);
virtual ~SUPERVGUI_CanvasGotoNode() {}
virtual QPopupMenu* getPopupMenu(QWidget* theParent);
Q_OBJECT
public:
- SUPERVGUI_CanvasCellNode(QObject* theParent,
- SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode);
+ SUPERVGUI_CanvasCellNode( SUIT_ResourceMgr*, QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode);
virtual ~SUPERVGUI_CanvasCellNode();
// asv : 26.01.05 : everything moved to CanvasNode::getPopupMenu()
class SUPERVGUI_CanvasCellEndNode: public SUPERVGUI_CanvasCellNode {
public:
- SUPERVGUI_CanvasCellEndNode(QObject* theParent,
- SUPERVGUI_Main* theMain,
- SUPERV_CNode theNode,
- SUPERVGUI_CanvasCellNode* theStart);
+ SUPERVGUI_CanvasCellEndNode( SUIT_ResourceMgr*, QObject* theParent,
+ SUPERVGUI_Main* theMain,
+ SUPERV_CNode theNode,
+ SUPERVGUI_CanvasCellNode* theStart);
virtual ~SUPERVGUI_CanvasCellEndNode() {}
// asv : 26.01.05 : decided to remove all "edition" operations on nodes in Table view
//=====================================================================
// Control node presentation
//=====================================================================
-SUPERVGUI_CanvasControlNodePrs::SUPERVGUI_CanvasControlNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasNode* theNode):
- SUPERVGUI_CanvasNodePrs(theCanvas, theNode)
+SUPERVGUI_CanvasControlNodePrs::SUPERVGUI_CanvasControlNodePrs( SUIT_ResourceMgr* mgr, QCanvas* theCanvas, SUPERVGUI_CanvasNode* theNode):
+ SUPERVGUI_CanvasNodePrs( mgr, theCanvas, theNode)
{
Trace("SUPERVGUI_CanvasControlNodePrs::SUPERVGUI_CanvasControlNodePrs");
setLabelVisible(false);
//=====================================================================
// Start control node presentation
//=====================================================================
-SUPERVGUI_CanvasStartNodePrs::SUPERVGUI_CanvasStartNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasStartNode* theNode):
- SUPERVGUI_CanvasControlNodePrs(theCanvas, theNode)
+SUPERVGUI_CanvasStartNodePrs::SUPERVGUI_CanvasStartNodePrs( SUIT_ResourceMgr* mgr, QCanvas* theCanvas, SUPERVGUI_CanvasStartNode* theNode):
+ SUPERVGUI_CanvasControlNodePrs( mgr, theCanvas, theNode)
{
Trace("SUPERVGUI_CanvasStartNodePrs::SUPERVGUI_CanvasStartNodePrs");
}
//=====================================================================
// End control node presentation
//=====================================================================
-SUPERVGUI_CanvasEndNodePrs::SUPERVGUI_CanvasEndNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasEndNode* theNode):
- SUPERVGUI_CanvasControlNodePrs(theCanvas, theNode)
+SUPERVGUI_CanvasEndNodePrs::SUPERVGUI_CanvasEndNodePrs( SUIT_ResourceMgr* mgr, QCanvas* theCanvas, SUPERVGUI_CanvasEndNode* theNode):
+ SUPERVGUI_CanvasControlNodePrs(mgr,theCanvas, theNode)
{
Trace("SUPERVGUI_CanvasEndNodePrs::SUPERVGUI_CanvasEndNodePrs");
}
//=====================================================================
// Goto control node presentation
//=====================================================================
-SUPERVGUI_CanvasGotoNodePrs::SUPERVGUI_CanvasGotoNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasGotoNode* theNode):
- SUPERVGUI_CanvasControlNodePrs(theCanvas, theNode)
+SUPERVGUI_CanvasGotoNodePrs::SUPERVGUI_CanvasGotoNodePrs( SUIT_ResourceMgr* mgr, QCanvas* theCanvas, SUPERVGUI_CanvasGotoNode* theNode):
+ SUPERVGUI_CanvasControlNodePrs(mgr, theCanvas, theNode)
{
Trace("SUPERVGUI_CanvasGotoNodePrs::SUPERVGUI_CanvasGotoNodePrs");
}
//=====================================================================
// Macro node presentation
//=====================================================================
-SUPERVGUI_CanvasMacroNodePrs::SUPERVGUI_CanvasMacroNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasMacroNode* theNode):
- SUPERVGUI_CanvasNodePrs(theCanvas, theNode)
+SUPERVGUI_CanvasMacroNodePrs::SUPERVGUI_CanvasMacroNodePrs( SUIT_ResourceMgr* mgr, QCanvas* theCanvas, SUPERVGUI_CanvasMacroNode* theNode):
+ SUPERVGUI_CanvasNodePrs( mgr, theCanvas, theNode)
{
Trace("SUPERVGUI_CanvasControlNodePrs::SUPERVGUI_CanvasControlNodePrs");
setNodeColor(QColor(255, 186, 149)); //QColor(255, 200, 170));
class SUPERVGUI_CanvasControlNodePrs : public SUPERVGUI_CanvasNodePrs
{
public:
- SUPERVGUI_CanvasControlNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasNode* theNode);
+ SUPERVGUI_CanvasControlNodePrs( SUIT_ResourceMgr*, QCanvas* theCanvas, SUPERVGUI_CanvasNode* theNode);
virtual ~SUPERVGUI_CanvasControlNodePrs() {}
virtual void hideAll();
class SUPERVGUI_CanvasStartNodePrs : public SUPERVGUI_CanvasControlNodePrs
{
public:
- SUPERVGUI_CanvasStartNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasStartNode* theNode);
+ SUPERVGUI_CanvasStartNodePrs( SUIT_ResourceMgr*, QCanvas* theCanvas, SUPERVGUI_CanvasStartNode* theNode);
virtual ~SUPERVGUI_CanvasStartNodePrs() {}
QPointArray areaPoints() const;
class SUPERVGUI_CanvasEndNodePrs : public SUPERVGUI_CanvasControlNodePrs
{
public:
- SUPERVGUI_CanvasEndNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasEndNode* theNode);
+ SUPERVGUI_CanvasEndNodePrs( SUIT_ResourceMgr*, QCanvas* theCanvas, SUPERVGUI_CanvasEndNode* theNode);
virtual ~SUPERVGUI_CanvasEndNodePrs() {}
QPointArray areaPoints() const;
class SUPERVGUI_CanvasGotoNodePrs : public SUPERVGUI_CanvasControlNodePrs
{
public:
- SUPERVGUI_CanvasGotoNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasGotoNode* theNode);
+ SUPERVGUI_CanvasGotoNodePrs( SUIT_ResourceMgr*, QCanvas* theCanvas, SUPERVGUI_CanvasGotoNode* theNode);
virtual ~SUPERVGUI_CanvasGotoNodePrs() {}
QPointArray areaPoints() const;
class SUPERVGUI_CanvasMacroNodePrs : public SUPERVGUI_CanvasNodePrs
{
public:
- SUPERVGUI_CanvasMacroNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasMacroNode* theNode);
+ SUPERVGUI_CanvasMacroNodePrs( SUIT_ResourceMgr*, QCanvas* theCanvas, SUPERVGUI_CanvasMacroNode* theNode);
virtual ~SUPERVGUI_CanvasMacroNodePrs() {}
QPointArray areaPoints() const;
#include "SUIT_Session.h"
-SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell):
+SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode( SUIT_ResourceMgr* mgr, QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell):
QObject(theParent),
myMain(theMain),
myNode(theNode),
step(true),
trace(true),
verbose(true),
- myBrowseDlg(0)
+ myBrowseDlg(0),
+ myMgr( mgr )
{
Trace("SUPERVGUI_CanvasNode::SUPERVGUI_CanvasNode");
SUPERVGUI_CanvasNodePrs* SUPERVGUI_CanvasNode::createPrs() const
{
- return new SUPERVGUI_CanvasNodePrs(myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
+ return new SUPERVGUI_CanvasNodePrs( myMgr, myMain->getCanvas(), (SUPERVGUI_CanvasNode*)this);
}
void SUPERVGUI_CanvasNode::createPort(SUPERV::Port_ptr thePort)
class SUPERVGUI_Main;
class SUPERVGUI_CanvasNodePrs;
+class SUIT_ResourceMgr;
class SUPERVGUI_CanvasNode : public QObject {
friend class SUPERVGUI_ManagePortsDlg;
Q_OBJECT
public:
- SUPERVGUI_CanvasNode(QObject* theParent, SUPERVGUI_Main* theMain, SUPERV_CNode theNode, bool theIsCell=false);
+ SUPERVGUI_CanvasNode( SUIT_ResourceMgr*, QObject*, SUPERVGUI_Main*, SUPERV_CNode theNode, bool theIsCell=false);
virtual ~SUPERVGUI_CanvasNode();
// done to ignore port update when node is removed
protected:
// redefined by most of CanvasNode successors
virtual SUPERVGUI_CanvasNodePrs* createPrs() const;
+ SUIT_ResourceMgr* resMgr() const { return myMgr; }
void createPort(SUPERV::Port_ptr thePort);
void createStreamPort(SUPERV::StreamPort_ptr thePort);
QString myLabelText;
SUPERVGUI_CanvasNodePrs* myPrs;
+ SUIT_ResourceMgr* myMgr;
bool myDestroyed;
#include "SUPERVGUI_Canvas.h"
#include "SUPERVGUI_CanvasCellNodePrs.h"
+#include "SUIT_ResourceMgr.h"
+
//#define CHECKTIME
#ifdef CHECKTIME
//=====================================================================
// Node presentation
//=====================================================================
-SUPERVGUI_CanvasNodePrs::SUPERVGUI_CanvasNodePrs(QCanvas* theCanvas,
- SUPERVGUI_CanvasNode* theNode,
- bool theCellPrs):
+SUPERVGUI_CanvasNodePrs::SUPERVGUI_CanvasNodePrs( SUIT_ResourceMgr* mgr, QCanvas* theCanvas,
+ SUPERVGUI_CanvasNode* theNode,
+ bool theCellPrs):
QCanvasPolygonalItem(theCanvas),
- myNode(theNode)
+ myNode(theNode),
+ myMgr( mgr )
{
Trace("SUPERVGUI_CanvasNodePrs::SUPERVGUI_CanvasNodePrs");
myWidth = LABEL_WIDTH;
myPortVisible = true;
myCellPrs = theCellPrs;
- myColor = MAIN_BACK;
+ myColor = mgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_BACK );
if (!myCellPrs) {
// create in/out connection points prs
void SUPERVGUI_CanvasNodePrs::drawTitle(QPainter& thePainter)
{
QBrush saved = thePainter.brush();
- QBrush br(MAIN_TITLE);
+ QBrush br( myMgr->colorValue( "SUPERVGraph", "Title", DEF_MAIN_TITLE ) );
thePainter.setBrush(br);
drawTitleShape(thePainter);
thePainter.setBrush(saved);
default:
myStatus = "No Status";
- myStatusColor = MAIN_BACK;
+ myStatusColor = myMgr->colorValue( "SUPERVGraph", "Background", DEF_MAIN_BACK );
break;
}
class SUPERVGUI_CanvasNodePrs;
class SUPERVGUI_CanvasPortPrs;
+class SUIT_ResourceMgr;
class SUPERVGUI_CanvasHookPrs : public QCanvasEllipse
{
public:
class SUPERVGUI_CanvasNodePrs: public QCanvasPolygonalItem {
public:
- SUPERVGUI_CanvasNodePrs(QCanvas* theCanvas, SUPERVGUI_CanvasNode* theNode, bool theCellPrs=false);
+ SUPERVGUI_CanvasNodePrs( SUIT_ResourceMgr*, QCanvas*, SUPERVGUI_CanvasNode*, bool theCellPrs=false);
virtual ~SUPERVGUI_CanvasNodePrs();
SUPERVGUI_CanvasNode* getNode() const { return myNode; }
virtual void drawTitleShape(QPainter& thePainter);
virtual void drawStatusShape(QPainter& thePainter);
+ SUIT_ResourceMgr* resMgr() const { return myMgr; }
bool myPortVisible;
private:
SUPERVGUI_CanvasNode* myNode;
+ SUIT_ResourceMgr* myMgr;
int myWidth;
#define MAIN_NEW "aNewDataFlow"
-#define MAIN_COLOR QColor(144, 208, 211)
-#define MAIN_TITLE QColor( 63, 213, 255)
-#define MAIN_CTRL QColor(255, 108, 106)
-#define MAIN_BACK QColor(NODE_RED, NODE_GREEN, NODE_BLUE)
+//ASL: these values are default if resource manager doesn't contain corresponding values
+#define DEF_MAIN_COLOR QColor(144, 208, 211)
+#define DEF_MAIN_TITLE QColor( 63, 213, 255)
+#define DEF_MAIN_CTRL QColor(255, 108, 106)
+#define DEF_MAIN_BACK QColor(NODE_RED, NODE_GREEN, NODE_BLUE)
// Taille du dataflow sous forme de graphe
// ---------------------------------------
};
*/
- objectBrowser = dynamic_cast<SalomeApp_Application*>( study->application() )->objectBrowser();
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( study->application() );
+
+ objectBrowser = app->objectBrowser();
- myArray = new SUPERVGUI_CanvasArray(this);
- myArrayView = new SUPERVGUI_ArrayView(myArray, this);
+ myArray = new SUPERVGUI_CanvasArray( this, resMgr() );
+ myArrayView = new SUPERVGUI_ArrayView( myArray, this );
- myCanvas = new SUPERVGUI_Canvas(this);
+ myCanvas = new SUPERVGUI_Canvas( this, resMgr() );
myCanvasView = new SUPERVGUI_CanvasView(myCanvas, this);
- message = dynamic_cast<SalomeApp_Application*>( study->application() )->logWindow();
+ message = app->logWindow();
notification = new NOTIFICATION_Consumer();
QBoxLayout * layout = new QVBoxLayout(this);
delete myArray;
}
+SUIT_ResourceMgr* SUPERVGUI_Main::resMgr() const
+{
+ SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( study->application() );
+ return app ? app->resourceMgr() : 0;
+}
+
void SUPERVGUI_Main::filterNotification() {
Trace("SUPERVGUI_Main::filterNotification");
SUPERVGUI_Notification* dlg = new SUPERVGUI_Notification(this);
case CANVAS:
case CONTROLFLOW:
{
- SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasComputeNode(myCanvas, this, theNode);
+ SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasComputeNode( resMgr(), myCanvas, this, theNode);
aNode->move(theNode->X(), theNode->Y());
if (myCurrentView == CONTROLFLOW) aNode->hideAll();
aNode->show();
case CANVAS:
case CONTROLFLOW:
{
- SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasGotoNode(myCanvas, this, theNode);
+ SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasGotoNode( resMgr(), myCanvas, this, theNode);
aNode->move(theNode->X(), theNode->Y());
if (myCurrentView == CONTROLFLOW) aNode->hideAll();
aNode->show();
case CANVAS:
case CONTROLFLOW:
{
- SUPERVGUI_CanvasStartNode* aStartNode = new SUPERVGUI_CanvasStartNode(myCanvas, this, theStartNode);
+ SUPERVGUI_CanvasStartNode* aStartNode = new SUPERVGUI_CanvasStartNode( resMgr(), myCanvas, this, theStartNode);
aStartNode->move(theStartNode->X(), theStartNode->Y());
if (myCurrentView == CONTROLFLOW) aStartNode->hideAll();
- SUPERVGUI_CanvasEndNode* aEndNode = new SUPERVGUI_CanvasEndNode(myCanvas, this, theEndNode, aStartNode);
+ SUPERVGUI_CanvasEndNode* aEndNode = new SUPERVGUI_CanvasEndNode( resMgr(), myCanvas, this, theEndNode, aStartNode);
aEndNode->move(theEndNode->X(), theEndNode->Y());
if (myCurrentView == CONTROLFLOW) aEndNode->hideAll();
case CANVAS:
case CONTROLFLOW:
{
- SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasMacroNode(myCanvas, this, theNode);
+ SUPERVGUI_CanvasNode* aNode = new SUPERVGUI_CanvasMacroNode( resMgr(), myCanvas, this, theNode);
aNode->move(theNode->X(), theNode->Y());
if (myCurrentView == CONTROLFLOW) aNode->hideAll();
aNode->show();
SUPERVGUI_Main(SUPERVGraph_ViewFrame*, SUIT_Desktop*/*QAD_Desktop**/, SUPERV_Graph);
virtual ~SUPERVGUI_Main();
+ SUIT_ResourceMgr* resMgr() const;
+
void run( const bool andSuspend );
void kill();
void suspendResume();