5 from Vispa.Main.Application
import Application
6 from Vispa.Views.BoxDecayView
import BoxDecayView
7 from Vispa.Gui.PortConnection
import PortConnection,PointToPointConnection
8 from Vispa.Gui.ConnectableWidget
import ConnectableWidget
9 from Vispa.Gui.WidgetContainer
import WidgetContainer
15 LABEL=
"ConfigEditor BoxView"
18 logging.debug(__name__ +
": __init__")
19 BoxDecayView.__init__(self, parent)
21 self.
_colors = [Qt.red, Qt.green, Qt.blue, Qt.cyan, Qt.magenta]
23 PointToPointConnection.CONNECTION_THICKNESS=2
24 self.setSortBeforeArranging(
False)
32 """ Sets the connections between the objects.
34 You need to call updateContent() in order to make the changes visible.
39 def createBox(self, widgetParent, container, title, text):
40 widget=BoxDecayView.createBox(self, widgetParent, container, title, text)
41 widget.setToolTip(
"Double click to display this module with its dependencies")
45 for connection,values
in self._connections.items():
50 if not Application.NO_PROCESS_EVENTS:
51 QCoreApplication.instance().processEvents()
53 if operationId != self._operationId:
55 w1 = self.widgetByObject(connection[0])
56 w2 = self.widgetByObject(connection[1])
58 if hasattr(w1,
"colorIndex"):
67 connectionWidget = self.createConnection(w1, values[0], w2, values[1], self.
_colors[col])
68 connectionWidget.show()
77 if isinstance(widget,ConnectableWidget):
78 widget.setColors(ConnectableWidget.PEN_COLOR,
79 ConnectableWidget.FILL_COLOR1,
80 ConnectableWidget.FILL_COLOR2)
81 elif isinstance(widget,WidgetContainer):
82 widget.setColors(WidgetContainer.PEN_COLOR,
83 WidgetContainer.FILL_COLOR1,
84 WidgetContainer.FILL_COLOR2)
88 widget = self.widgetByObject(object)
91 if isinstance(widget,ConnectableWidget):
92 widget.setColors(ConnectableWidget.PEN_COLOR.darker(),
93 ConnectableWidget.FILL_COLOR1,
94 ConnectableWidget.FILL_COLOR2)
95 elif isinstance(widget,WidgetContainer):
96 widget.setColors(WidgetContainer.PEN_COLOR.darker(),
97 WidgetContainer.FILL_COLOR1,
98 WidgetContainer.FILL_COLOR2)
104 ok=BoxDecayView.updateContent(self,overrideCheck)
109 LABEL=
"Connection structure"
112 LABEL=
"Sequence structure"