Exemplo n.º 1
0
    def __init__(self, parent, transformation, scaleDivision, logger=None):
        super(ColorScaleWidget, self).__init__()

        self.titleWidget = ColorTitleWidget("Scale Widget Title", self)
        self.scaleBar = ColorScaleBar(self, transformation, scaleDivision)

        plotLayout = QtWidgets.QGridLayout()
        plotLayout.setSpacing(0)
        plotLayout.setContentsMargins(0, 0, 0, 0)
        plotLayout.addWidget(self.scaleBar, 0, 0)
        plotLayout.addWidget(self.titleWidget, 0, 1)

        self.setLayout(plotLayout)
Exemplo n.º 2
0
class ColorScaleWidget(QtWidgets.QWidget):
    def __init__(self, parent, transformation, scaleDivision, logger=None):
        super(ColorScaleWidget, self).__init__()

        self.titleWidget = ColorTitleWidget("Scale Widget Title", self)
        self.scaleBar = ColorScaleBar(self, transformation, scaleDivision)

        plotLayout = QtWidgets.QGridLayout()
        plotLayout.setSpacing(0)
        plotLayout.setContentsMargins(0, 0, 0, 0)
        plotLayout.addWidget(self.scaleBar, 0, 0)
        plotLayout.addWidget(self.titleWidget, 0, 1)

        self.setLayout(plotLayout)

    def setTitle(self, title):
        self.titleWidget.setTitle(title)

    def setScaleProperties(self, transformation, scaleDivision):
        self.scaleBar.set_scale_properties(transformation, scaleDivision)

    def spacingBorders(self):
        return self.scaleBar.spacingBorders()