def getBallLabel(self, colorStr): """ sets the ball label :param colorStr: the color fo the ball as string :return: """ ls = self.pool.get(colorStr) if ls == []: pxmap = QPixmap(self._getBallFile(colorStr)) ball = QLabel(parent=self.frame) ball.setPixmap(pxmap) ball.setScaledContents(True) ball.setFixedSize(self.size, self.size) ball.show() return ball else: ball = ls.pop() ball.show() return ball
def getUndefLabel(self, colorStr): """ initiates the undefined label :param colorStr: color as string :return: """ ls = self.pool.get(colorStr) if ls == []: pxmap = QPixmap(self._getUndefFile(colorStr)) undf = QLabel(parent=self.frame) undf.setPixmap(pxmap) undf.setScaledContents(True) undf.setFixedSize(self.size, self.size) undf.show() return undf else: undf = ls.pop() undf.show() return undf
def getTeammateLabel(self, colorStr): """ initaties the teammate label for the quarter field :param colorStr: color as string :return: """ ls = self.pool.get(colorStr) if ls == []: pxmap = QPixmap(self._getTeammateFile(colorStr)) mate = QLabel(parent=self.frame) mate.setPixmap(pxmap) mate.setScaledContents(True) mate.setFixedSize(self.size, self.size) mate.show() return mate else: mate = ls.pop() mate.show() return mate
def getOpponentLabel(self, colorStr): """ initiates the opponent label :param colorStr: color as string :return: """ ls = self.pool.get(colorStr) if ls == []: pxmap = QPixmap(self._getOpponentFile(colorStr)) opp = QLabel(parent=self.frame) opp.setPixmap(pxmap) opp.setScaledContents(True) opp.setFixedSize(self.size, self.size) opp.show() return opp else: opp = ls.pop() opp.show() return opp
def getCrossLabel(self, colorStr): """ initiates the cross label :param colorStr: color as string :return: """ ls = self.pool.get(colorStr) if ls == []: pxmap = QPixmap(self._getCrossFile(colorStr)) crs = QLabel(parent=self.frame) crs.setPixmap(pxmap) crs.setScaledContents(True) crs.setFixedSize(self.size, self.size) crs.show() return crs else: crs = ls.pop() crs.show() return crs
def getRobotLabel(self, colorStr): """ initiates the robot label :param colorStr: color as string :return: """ ls = self.pool.get(colorStr) if ls == []: pxmap = QPixmap(self._getRobFile(colorStr)) rob = QLabel(parent=self.frame) rob.setPixmap(pxmap) rob.originalPixmap = QPixmap(pxmap) rob.setScaledContents(True) rob.setFixedSize(self.size, self.size) rob.show() return rob else: rob = ls.pop() rob.show() return rob