Ejemplo n.º 1
0
 def getListCellRendererComponent(self, lst, value, index, isSelected, cellHasFocus):
     text = value["text"]
     renderer = JTextArea(text=text)
     renderer.foreground = self.colormap[value["type"]]
     renderer.font = self.font
     if isSelected:
         renderer.background = Color.YELLOW
     return renderer
Ejemplo n.º 2
0
 def getListCellRendererComponent(self, lst, value, index, isSelected, cellHasFocus):
     text = value["text"]
     renderer = JTextArea(text=text)
     renderer.foreground = self.colormap[value["type"]]
     renderer.font = self.font
     if isSelected:
         renderer.background = Color.YELLOW
     return renderer
    def initGUI(self):
        #Set up subpanel1
        appName = JTextArea('Politeness Gauge\n' +
                            '\nSarah Robinson \nAnna Clegg')
        appName.setLineWrap(True)
        appName.setWrapStyleWord(True)
        appName.setEditable(False)
        appName.background = 240, 240, 240
        instructions = JTextArea(
            '   Ever agonized over whether or not your emails' +
            ' are polite enough? \n    Never fear! With our politeness gauge' +
            ' we can provide suggestions on improving your emails' +
            ' with just the click of a button.  \n    Just type your email ' +
            'into the text box below and hit Score!')
        instructions.setLineWrap(True)
        instructions.setWrapStyleWord(True)
        instructions.background = 240, 240, 240
        northPanel = JPanel(GridLayout(2, 1))
        northPanel.add(appName)
        northPanel.add(instructions)
        self.subPanel1.add(northPanel, BorderLayout.NORTH)

        self.userText.setEditable(True)
        self.userText.setLineWrap(True)
        self.userText.setWrapStyleWord(True)
        self.userText.setRows(100)
        #self.userText.wordWrap = True
        self.subPanel1.add(self.userText, BorderLayout.CENTER)

        self.subPanel1.add(self.button, BorderLayout.SOUTH)

        label = JLabel("Politeness Evaluation")
        self.subPanel2.add(label)
        self.subPanel2.add(self.emoticonFeedback)
        self.subPanel2.add(self.curseFeedback)
        self.subPanel2.add(self.styleFeedback)
        self.subPanel2.add(self.overallFeedback)

        self.mainPanel.add(self.subPanel1)
        self.mainPanel.add(self.subPanel2)
 def initGUI(self):
     #Set up subpanel1
     appName = JTextArea('Politeness Gauge\n'+'\nSarah Robinson \nAnna Clegg')
     appName.setLineWrap(True)
     appName.setWrapStyleWord(True)
     appName.setEditable(False)
     appName.background =  240,240,240
     instructions = JTextArea('   Ever agonized over whether or not your emails' +
                 ' are polite enough? \n    Never fear! With our politeness gauge' +
                 ' we can provide suggestions on improving your emails' +
                 ' with just the click of a button.  \n    Just type your email ' +
                 'into the text box below and hit Score!')
     instructions.setLineWrap(True)
     instructions.setWrapStyleWord(True)
     instructions.background = 240,240,240
     northPanel = JPanel(GridLayout(2,1))
     northPanel.add(appName)
     northPanel.add(instructions)
     self.subPanel1.add(northPanel, BorderLayout.NORTH)  
     
     self.userText.setEditable(True)
     self.userText.setLineWrap(True)
     self.userText.setWrapStyleWord(True)
     self.userText.setRows(100)
     #self.userText.wordWrap = True
     self.subPanel1.add(self.userText, BorderLayout.CENTER)
     
     self.subPanel1.add(self.button, BorderLayout.SOUTH)
     
     label = JLabel("Politeness Evaluation")
     self.subPanel2.add(label)
     self.subPanel2.add(self.emoticonFeedback)
     self.subPanel2.add(self.curseFeedback)
     self.subPanel2.add(self.styleFeedback)
     self.subPanel2.add(self.overallFeedback)
     
     self.mainPanel.add(self.subPanel1)
     self.mainPanel.add(self.subPanel2)