Пример #1
0
    def __init__(self, param, parent=None):
        """__init__(param: core.vistrail.module_param.ModuleParam,
                    parent: QWidget)
        Initializes the line edit with contents
        """
        dictkey = param._namespace
        typedict = packages.webServices.webServicesmodulesDict[dictkey]
        w = param._namespace.replace('|Types', '')
        dictkey = w + "." + param._type
        obj = typedict[dictkey]
        self.enumerationlist = obj.ports[0][0]
        QtGui.QComboBox.__init__(self, parent)
        ConstantWidgetMixin.__init__(self, param.strValue)
        QtGui.QComboBox.clear(self)
        listqt = QtCore.QStringList()
        for element in self.enumerationlist:
            listqt.append(element)

        QtGui.QComboBox.addItems(self, listqt)
        foundindex = self.findText(param.strValue)
        if not foundindex == -1:
            self.setCurrentIndex(foundindex)
        else:
            self.setCurrentIndex(0)
            param.strValue = self.enumerationlist[self.currentIndex()]
        self.connect(self, QtCore.SIGNAL('activated(int)'), self.change_state)
Пример #2
0
    def __init__(self, param, available_tree, parent=None):
        """__init__(param: core.vistrail.module_param.ModuleParam,
                    parent: QWidget)

        Initialize the line edit with its contents. Content type is limited
        to 'int', 'float', and 'string'

        """
        PredictorListWidget.__init__(self, param.strValue, available_tree, 
                                     parent)
        ConstantWidgetMixin.__init__(self, param.strValue)
        # assert param.namespace == None
        # assert param.identifier == 'edu.utah.sci.vistrails.basic'
#         self.available_tree = available_tree
#         self.setColumnCount(2)
#         for source, file_list in self.available_tree.iteritems():
#             source_item = QtGui.QTreeWidgetItem([source])
#             self.addTopLevelItem(source_item)
#             for (file, desc) in file_list:
#                 child_item = QtGui.QTreeWidgetItem([file, desc])
#                 child_item.setFlags(QtCore.Qt.ItemIsUserCheckable |
#                                     QtCore.Qt.ItemIsEnabled)
#                 child_item.setCheckState(0, QtCore.Qt.Unchecked)
#                 source_item.addChild(child_item)

        contents = param.strValue
        contentType = param.type

        # need to deserialize contents and set tree widget accordingly
        # self.setText(contents)
        self._contentType = contentType
 def __init__(self, param, parent=None):
     """__init__(param: core.vistrail.module_param.ModuleParam,
                 parent: QWidget)
     Initializes the line edit with contents
     """
     dictkey = param._namespace
     typedict = packages.webServices.webServicesmodulesDict[dictkey]
     w = param._namespace.replace('|Types','')
     dictkey = w + "." + param._type
     obj = typedict[dictkey]
     self.enumerationlist = obj.ports[0][0]
     QtGui.QComboBox.__init__(self, parent)
     ConstantWidgetMixin.__init__(self, param.strValue)
     QtGui.QComboBox.clear(self)
     listqt = QtCore.QStringList()
     for element in self.enumerationlist:
         listqt.append(element)
         
     QtGui.QComboBox.addItems(self, listqt)
     foundindex = self.findText(param.strValue)
     if not foundindex == -1:
         self.setCurrentIndex(foundindex)
     else:
         self.setCurrentIndex(0)
         param.strValue = self.enumerationlist[self.currentIndex()]
     self.connect(self, QtCore.SIGNAL('activated(int)'), self.change_state)
Пример #4
0
 def __init__(self, param, parent=None):
     self.param = param
     self.strValue = param.strValue
     contentsType = param.type
     QtGui.QWidget.__init__(self, parent)
     ConstantWidgetMixin.__init__(self, param.strValue)
     layout = QtGui.QHBoxLayout()
     # FIXME Use a greyed QLineEdit?
     # layout.addWidget(QtGui.QLabel("File Info:"))
     button = QtGui.QPushButton("Configure")
     button.setMaximumWidth(100)
     self.connect(button, QtCore.SIGNAL('clicked()'), self.run_dialog)
     layout.addWidget(button)
     layout.setMargin(5)
     layout.setSpacing(5)
     self.setLayout(layout)
 def __init__(self, param, parent=None):
     self.param = param
     self.strValue = param.strValue
     contentsType = param.type
     QtGui.QWidget.__init__(self, parent)
     ConstantWidgetMixin.__init__(self, param.strValue)
     layout = QtGui.QHBoxLayout()
     # FIXME Use a greyed QLineEdit?
     # layout.addWidget(QtGui.QLabel("File Info:"))
     button = QtGui.QPushButton("Configure")
     button.setMaximumWidth(100)
     self.connect(button, QtCore.SIGNAL("clicked()"), self.run_dialog)
     layout.addWidget(button)
     layout.setMargin(5)
     layout.setSpacing(5)
     self.setLayout(layout)
Пример #6
0
    def __init__(self, param, parent=None):
        """__init__(param: core.vistrail.module_param.ModuleParam,
                    parent: QWidget)

        """
        contents = param.strValue
        contentType = param.type
        QtGui.QComboBox.__init__(self, parent)
        ConstantWidgetMixin.__init__(self, param.strValue)
        # want to look up in registry based on parameter type

        self.addItem('')
        for val in self.param_values:
            self.addItem(val)

        curIdx = self.findText(contents)
        if curIdx != -1:
            self.setCurrentIndex(curIdx)
        self._contentType = contentType
        self.connect(self, QtCore.SIGNAL('currentIndexChanged(int)'),
                     self.update_parent)
Пример #7
0
    def __init__(self, param, parent=None):
        """__init__(param: core.vistrail.module_param.ModuleParam,
                    parent: QWidget)

        """
        contents = param.strValue
        contentType = param.type
        QtGui.QComboBox.__init__(self, parent)
        ConstantWidgetMixin.__init__(self, param.strValue)
        # want to look up in registry based on parameter type
        
        self.addItem('')
        for val in self.param_values:
            self.addItem(val)

        curIdx = self.findText(contents)
        if curIdx != -1:
            self.setCurrentIndex(curIdx)
        self._contentType = contentType
        self.connect(self,
                     QtCore.SIGNAL('currentIndexChanged(int)'),
                     self.update_parent)
Пример #8
0
 def __init__(self, param, parent=None):
     QtGui.QWidget.__init__(self, parent)
     ConstantWidgetMixin.__init__(self, param.strValue)
     if not param.strValue:
         self._tf = copy.copy(default_tf)
     else:
         self._tf = pickle.loads(param.strValue.decode('hex'))
     self._scene = TransferFunctionScene(self._tf, self)
     layout = QtGui.QVBoxLayout()
     self.setLayout(layout)
     self._view = TransferFunctionView()
     self._view.setScene(self._scene)
     self._view.setMinimumSize(200, 200)
     self._view.show()
     self._view.setSizePolicy(QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Expanding)
     self._view.setMatrix(QtGui.QMatrix(180, 0, 0, -180, 0, 0))
     self.setMinimumSize(200, 200)
     caption = QtGui.QLabel("Double-click on the line to add a point")
     font = QtGui.QFont('Arial', 11)
     font.setItalic(True)
     caption.setFont(font)
     layout.addWidget(self._view)
     layout.addWidget(caption)
Пример #9
0
 def __init__(self, param, parent=None):
     QtGui.QWidget.__init__(self, parent)
     ConstantWidgetMixin.__init__(self, param.strValue)
     if not param.strValue:
         self._tf = copy.copy(default_tf)
     else:
         self._tf = pickle.loads(param.strValue.decode('hex'))
     self._scene = TransferFunctionScene(self._tf, self)
     layout = QtGui.QVBoxLayout()
     self.setLayout(layout)
     self._view = TransferFunctionView()
     self._view.setScene(self._scene)
     self._view.setMinimumSize(200,200)
     self._view.show()
     self._view.setSizePolicy(QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Expanding)
     self._view.setMatrix(QtGui.QMatrix(180, 0, 0, -180, 0, 0))
     self.setMinimumSize(200,200)
     caption = QtGui.QLabel("Double-click on the line to add a point")
     font = QtGui.QFont('Arial', 11)
     font.setItalic(True)
     caption.setFont(font)
     layout.addWidget(self._view)
     layout.addWidget(caption)