예제 #1
0
    def __init__(self, parent):
        self.parent = parent

        Panel = swing.JPanel()
        Panel.layout = awt.BorderLayout()
        Panel.border = swing.BorderFactory.createTitledBorder(
            "Payload Encoder")
        self.text = swing.JTextField(actionPerformed=self.encodePayload)
        Panel.add(self.text, Panel.layout.PAGE_START)

        self.textArea = swing.JTextArea()
        scrollPane = swing.JScrollPane(self.textArea)

        Panel.add(scrollPane, Panel.layout.CENTER)

        Panel1 = swing.JPanel()
        Panel1.layout = awt.BorderLayout()
        Panel1.border = swing.BorderFactory.createTitledBorder(
            "Payload Parser")
        self.text1 = swing.JTextField(actionPerformed=self.parsePayload)
        Panel1.add(self.text1, Panel1.layout.PAGE_START)

        self.textArea1 = swing.JTextArea()
        scrollPane1 = swing.JScrollPane(self.textArea1)

        Panel1.add(scrollPane1, Panel1.layout.CENTER)

        self.splitPane = swing.JSplitPane(swing.JSplitPane.VERTICAL_SPLIT)

        self.splitPane.setDividerLocation(250)
        self.splitPane.setLeftComponent(Panel)
        self.splitPane.setRightComponent(Panel1)

        self.parent.addTabPanel("Options", self.splitPane)
예제 #2
0
 def registerExtenderCallbacks(self, callbacks):
     self._callbacks = callbacks
     self._helpers = callbacks.getHelpers()
     self.context = None
     callbacks.setExtensionName("quoted-printable Parser")
     self._jPanel = swing.JPanel()
     self._jPanel.setLayout(
         swing.BoxLayout(self._jPanel, swing.BoxLayout.Y_AXIS))
     self._jTextIn = swing.JTextArea("Input", 20, 10)
     self._jTextIn.setLineWrap(True)
     self._jScrollPaneIn = swing.JScrollPane(self._jTextIn)
     self._jScrollPaneIn.setVerticalScrollBarPolicy(
         swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS)
     self._jScrollPaneIn.setPreferredSize(awt.Dimension(20, 10))
     self._jTextOut = swing.JTextArea("Output", 20, 10)
     self._jTextOut.setLineWrap(True)
     self._jScrollPaneOut = swing.JScrollPane(self._jTextOut)
     self._jScrollPaneOut.setVerticalScrollBarPolicy(
         swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS)
     self._jScrollPaneOut.setPreferredSize(awt.Dimension(20, 10))
     self._jButtonPanel = swing.JPanel()
     self._jButtonDecode = swing.JButton('Decode',
                                         actionPerformed=self.decode)
     self._jButtonPanel.add(self._jButtonDecode)
     self._jPanel.add(self._jScrollPaneIn)
     self._jPanel.add(self._jButtonPanel)
     self._jPanel.add(self._jScrollPaneOut)
     callbacks.customizeUiComponent(self._jPanel)
     callbacks.addSuiteTab(self)
     return
예제 #3
0
 def showDPAm2g(self, lines_m2g
                ):  #w# show DPA mapping from metabolites to essential genes
     self.table_m2g = OutputTable.OutputTable(self.metabolicModel)
     self.table_m2g.write(lines_m2g, 'DPAm2g')
     tab_m2g = swing.JScrollPane(self.table_m2g)
     TabCloser("DPA_met2genes").put(tab_m2g, self)
     self.table_m2g.setColWidths_gsa(self.getWidth())
예제 #4
0
    def initUI(self):
        self.tab = swing.JPanel()

        # UI for Output
        self.outputLabel = swing.JLabel("pMDetector Log:")
        self.outputLabel.setFont(Font("Tahoma", Font.BOLD, 14))
        self.outputLabel.setForeground(Color(255, 102, 52))
        self.logPane = swing.JScrollPane()
        self.outputTxtArea = swing.JTextArea()
        self.outputTxtArea.setFont(Font("Consolas", Font.PLAIN, 12))
        self.outputTxtArea.setLineWrap(True)
        self.logPane.setViewportView(self.outputTxtArea)
        self.clearBtn = swing.JButton("Clear Log", actionPerformed=self.clear)
        self.exportBtn = swing.JButton("Export Log",
                                       actionPerformed=self.export)
        self.parentFrm = swing.JFileChooser()

        # Layout
        layout = swing.GroupLayout(self.tab)
        layout.setAutoCreateGaps(True)
        layout.setAutoCreateContainerGaps(True)
        self.tab.setLayout(layout)

        layout.setHorizontalGroup(layout.createParallelGroup().addGroup(
            layout.createSequentialGroup().addGroup(
                layout.createParallelGroup().addComponent(
                    self.outputLabel).addComponent(self.logPane).addComponent(
                        self.clearBtn).addComponent(self.exportBtn))))

        layout.setVerticalGroup(layout.createParallelGroup().addGroup(
            layout.createParallelGroup().addGroup(
                layout.createSequentialGroup().addComponent(
                    self.outputLabel).addComponent(self.logPane).addComponent(
                        self.clearBtn).addComponent(self.exportBtn))))
예제 #5
0
    def initGui(self):
        self.sigv4ConfigurationTab = swing.JPanel()
        layout = swing.GroupLayout(self.sigv4ConfigurationTab)
        self.sigv4ConfigurationTab.setLayout(layout)

        self.addDomainInfo = swing.JLabel("Domain to test:")
        self.addDomainInfo.setFont(Font("Tahoma", 1, 12))
        self.configurationLoadedInfo = swing.JLabel("")
        self.configurationLoadedInfo.setFont(Font("Tahoma", 1, 12))
        self.isJsonCheck = swing.JCheckBox("JSON")
        self.isJsonCheck.setFont(Font("Tahoma", 1, 12))
        self.parseCredsBtn = swing.JButton('Load configuration', actionPerformed=self.parseCreds)
        self.credsPanel = swing.JScrollPane()
        self.credsText = swing.JTextArea("Paste Creds Here.")
        self.credsText.setLineWrap(True)
        self.credsPanel.setViewportView(self.credsText)
        self.scopeUrlField = swing.JTextField("api.example.io")

        layout.setHorizontalGroup(
            layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(15)
                .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING)
                    .addComponent(self.isJsonCheck)
                    .addComponent(self.credsPanel, swing.GroupLayout.PREFERRED_SIZE, 525, swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(self.addDomainInfo)
                    .addComponent(self.scopeUrlField, swing.GroupLayout.PREFERRED_SIZE, 350, swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(self.parseCredsBtn))
                            .addComponent(self.configurationLoadedInfo)
                        .addPreferredGap(swing.LayoutStyle.ComponentPlacement.UNRELATED))
                    .addComponent(self.addDomainInfo))
                .addContainerGap(26, lang.Short.MAX_VALUE)))

        layout.setVerticalGroup(
            layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10)
                .addComponent(self.isJsonCheck)
                .addGap(10)
                .addComponent(self.credsPanel, swing.GroupLayout.PREFERRED_SIZE, 125, swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10)
                        .addComponent(self.addDomainInfo)
                        .addGap(10)
                        .addComponent(self.scopeUrlField, swing.GroupLayout.PREFERRED_SIZE, swing.GroupLayout.DEFAULT_SIZE, swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createParallelGroup(swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(10)
                                .addComponent(self.parseCredsBtn)
                                .addGap(10)
                                .addComponent(self.configurationLoadedInfo)
                                .addPreferredGap(swing.LayoutStyle.ComponentPlacement.RELATED)
                .addPreferredGap(swing.LayoutStyle.ComponentPlacement.RELATED)
                .addContainerGap(swing.GroupLayout.DEFAULT_SIZE, lang.Short.MAX_VALUE)))))))
        
        return 
예제 #6
0
 def registerExtenderCallbacks(self, callbacks):
     self.hashes = {}
     #self._stdout = PrintWriter(callbacks.getStdout(), True)
     self._callbacks = callbacks
     self._helpers = callbacks.getHelpers()
     self._callbacks.setExtensionName("Password Hash Scanner")
     self._callbacks.registerScannerCheck(self)
     self._fileLocation = None
     self._jPanel = swing.JPanel()
     boxVertical = swing.Box.createVerticalBox()
     boxHorizontal = swing.Box.createHorizontalBox()
     getFileButton = swing.JButton('Open hashout.txt',
                                   actionPerformed=self.getFile)
     self._fileText = swing.JTextArea("", 1, 50)
     boxHorizontal.add(getFileButton)
     boxHorizontal.add(self._fileText)
     boxVertical.add(boxHorizontal)
     boxHorizontal = swing.Box.createHorizontalBox()
     submitQueryButton = swing.JButton('Parse hash file',
                                       actionPerformed=self.hashParse)
     boxHorizontal.add(submitQueryButton)
     boxVertical.add(boxHorizontal)
     boxHorizontal = swing.Box.createHorizontalBox()
     boxHorizontal.add(swing.JLabel("Output"))
     boxVertical.add(boxHorizontal)
     boxHorizontal = swing.Box.createHorizontalBox()
     self._resultsTextArea = swing.JTextArea()
     resultsOutput = swing.JScrollPane(self._resultsTextArea)
     resultsOutput.setPreferredSize(Dimension(500, 200))
     boxHorizontal.add(resultsOutput)
     boxVertical.add(boxHorizontal)
     self._jPanel.add(boxVertical)
     # add the custom tab to Burp's UI
     self._callbacks.addSuiteTab(self)
     return
예제 #7
0
    def __init__(self):
        self.size = ABOUT_WINDOW_SIZE
        self.title = ABOUT_TITLE
        self.setLocationRelativeTo(None)
        self.contentPane.setLayout(
            swing.BoxLayout(self.contentPane, swing.BoxLayout.Y_AXIS))

        copyrightInfoArea = swing.JTextPane()
        copyrightInfoArea.setEditable(0)

        #Load copyright information from the JES copyright file
        copyrightFile = open(COPYRIGHT_FILE, 'r')
        copyrightInfoArea.text = copyrightFile.read()
        copyrightInfoArea.setCaretPosition(0)
        copyrightFile.close()

        okButton = swing.JButton(OK_BUTTON_CAPTION, actionListener=self)

        topPane = swing.JScrollPane(copyrightInfoArea)
        topPane.setPreferredSize(
            awt.Dimension(lang.Short.MAX_VALUE, lang.Short.MAX_VALUE))
        bottomPanel = swing.JPanel()
        bottomPanel.add(okButton)
        self.contentPane.add(topPane)
        self.contentPane.add(bottomPanel)
예제 #8
0
 def create_log_pane(self, logTA):
     lp = swing.JScrollPane(logTA)
     lp.setBorder(EtchedBorder(EtchedBorder.RAISED))
     lp.setVerticalScrollBarPolicy(
         swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS)
     lp.setPreferredSize(Dimension(Short.MAX_VALUE, 60))
     return lp
 def createGui( self ):
     
     jp = swing.JPanel( java.awt.BorderLayout() )
     self.jtp = jtp = swing.JEditorPane( "text/html", "" , editable = 0 )
     self.jsp = jsp = swing.JScrollPane( jtp )
     jb = self.jsp.getBorder()
     self.tb = tb = swing.border.TitledBorder( jb )
     self.tb2 = tb2 = swing.border.TitledBorder( tb, "", tb.CENTER, tb.BOTTOM )
     self.jsp.setBorder( self.tb2 )
     jp.add( jsp )
     jp2 = swing.JPanel()
     
     self.label = swing.JLabel()    
     self._question = question = swing.JButton( "Question" )
     question.actionPerformed = self.question
     self._answer = answer = swing.JButton( "Answer" )
     answer.actionPerformed = self.answer
     self._back = back = swing.JButton( "Back" )
     back.actionPerformed = self.back
     self._next = next = swing.JButton( "Next" )
     next.actionPerformed = self.next
     for z in ( question, answer, back, next ):
         jp2.add( z )
         
     jp.add( jp2, java.awt.BorderLayout.SOUTH )
     return jp
예제 #10
0
    def showMismatchTable(self):

        jf = swing.JFrame()

        jf.setDefaultCloseOperation(jf.DISPOSE_ON_CLOSE)
        cp = jf.getContentPane()
        cp.setLayout(awt.BorderLayout())
        jt = swing.JTable(self._dtm)
        jt.setAutoResizeMode(jt.AUTO_RESIZE_ALL_COLUMNS)
        drend = self._dftcr()
        jt.setDefaultRenderer(java.lang.Object, drend)
        count = self._dtm.getRowCount()
        tmp_label = swing.JLabel(java.lang.String.valueOf(count))
        psize = tmp_label.getPreferredSize()
        column = jt.getColumn("")
        column.setPreferredWidth(psize.width + 10)
        column.setMaxWidth(psize.width + 10)
        sp = swing.JScrollPane(jt)
        sp.addComponentListener(drend)
        cp.add(sp, awt.BorderLayout.CENTER)
        jb = swing.JButton("Close")
        jb.actionPerformed = lambda event: jf.dispose()
        cp.add(jb, awt.BorderLayout.SOUTH)
        jf.pack()
        g.app.gui.center_dialog(jf)
        jf.visible = 1
예제 #11
0
    def __init__(self):
        self.myFrame = swing.JFrame.__init__(self, 'Fragments')

        self.mydlg = EditFragment(self)
        self.mySession = ActiveSession(_session)

        self.myListModel = swing.DefaultListModel()
        self.myList = swing.JList(self.myListModel)
        myMidPanel = swing.JScrollPane(self.myList)

        myTopPanel = swing.JPanel()
        self.myEntry = swing.JTextField(40)
        myTopPanel.add(self.myEntry)
        myTopPanel.add(swing.JButton('Add', actionPerformed=self.AddValue))
        myTopPanel.add(swing.JButton('Trim', actionPerformed=self.TrimValue))
        myTopPanel.add(
            swing.JButton('[Enter]', actionPerformed=self.EnterValue))

        myPanel = swing.JPanel()
        myPanel.add(swing.JButton('Edit', actionPerformed=self.EditValue))
        myPanel.add(swing.JButton('Remove', actionPerformed=self.RemoveValue))
        myPanel.add(swing.JButton('Use', actionPerformed=self.UseValue))
        myPanel.add(
            swing.JButton('Refresh', actionPerformed=self.RefreshSessions))
        myPanel.add(swing.JButton('Save', actionPerformed=self.SaveValue))
        myPanel.add(swing.JButton('Restore', actionPerformed=self.RstValue))

        self.contentPane.add(myTopPanel, awt.BorderLayout.NORTH)
        self.contentPane.add(myMidPanel, awt.BorderLayout.CENTER)
        self.contentPane.add(myPanel, awt.BorderLayout.SOUTH)

        self.pack()
예제 #12
0
    def __init__(self):
        self.frame=swing.JFrame(title="Simple Jython Interpreter", size=(600,500))
        self.frame.defaultCloseOperation=swing.JFrame.EXIT_ON_CLOSE;
        self.frame.layout=awt.BorderLayout()
        self.panel1=swing.JPanel(awt.BorderLayout())
        self.panel2=swing.JPanel(awt.BorderLayout())


        self.title=swing.JLabel("Jython Code")
        self.title2 = swing.JLabel("Interpreter Output")
        self.button1=swing.JButton("Run", actionPerformed=self.printMessage)
        self.button2=swing.JButton("Clear Output", actionPerformed=self.clearMessage)

        self.buttonPane = swing.JPanel()
        self.buttonPane.layout = swing.BoxLayout(self.buttonPane, swing.BoxLayout.LINE_AXIS)
        self.buttonPane.border = swing.BorderFactory.createEmptyBorder(0, 10, 10, 10)
        self.buttonPane.add(swing.Box.createHorizontalGlue())
        self.buttonPane.add(self.button1)
        self.buttonPane.add(swing.Box.createRigidArea(awt.Dimension(10, 0)))
        self.buttonPane.add(self.button2)

        self.textField=swing.JTextArea(4,15)
        self.textField.lineWrap = True
        self.scrollPaneOne = swing.JScrollPane(self.textField)
        self.scrollPaneOne.verticalScrollBarPolicy = swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS
        self.outputText=swing.JTextArea(4,15)
        self.outputText.lineWrap = True
        self.outputText.editable = False
        self.scrollPane2 = swing.JScrollPane(self.outputText)
        self.scrollPane2.verticalScrollBarPolicy = swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS
        

        self.panel1.add(self.title, awt.BorderLayout.PAGE_START)
        self.panel1.add(self.scrollPaneOne, awt.BorderLayout.CENTER)
        self.panel2.add(self.title2, awt.BorderLayout.PAGE_START)
        self.panel2.add(self.scrollPane2, awt.BorderLayout.CENTER)

        self.splitPane = swing.JSplitPane(swing.JSplitPane.VERTICAL_SPLIT,
                         self.panel1, self.panel2)
        self.splitPane.oneTouchExpandable = True
        self.minimumSize = awt.Dimension(50, 100)
        self.panel1.minimumSize = self.minimumSize
        self.panel2.minimumSize = self.minimumSize

        self.frame.contentPane.add(self.splitPane, awt.BorderLayout.CENTER)
        self.frame.contentPane.add(self.buttonPane, awt.BorderLayout.PAGE_END)
예제 #13
0
 def showNutrient(self):  #w# show nutrients settings for sgni/wgni problem
     externals = self.metabolicModel.getExternals()
     self.nutset = NutrientTable.NutrientSet(externals)
     tm = NutrientTable.NutsTableModel(self.nutset)
     table = NutrientTable.NutsTable(tm)
     #        test, present=nutset.getNutSetting()
     scrollpane = swing.JScrollPane(table)
     TabCloser("Nutrients").put(scrollpane, self)
     table.setColWidths_gsa(self.getWidth())
예제 #14
0
 def reportSolution(self, output):
     outputtable = OutputTable.OutputTable(self.metabolicModel)
     outputtable.write(output, self.program)
     tab = swing.JScrollPane(outputtable)
     self.outputs.append(tab)
     TabCloser(self.program).put(tab, self)
     outputtable.setColWidths(self.getWidth())
     if self.listener:
         self.listener()
예제 #15
0
 def showXY(self):
     xy = PlotPanel.XYPanel()
     for i in range(self.getTabCount()):
         if self.getTitleAt(i) in PLOTTABLES:
             table = self.getTableAt(i)
             lists = table.getSelectedLists(range(0, 3))
             xy.addLists(lists)
     scrollpane = swing.JScrollPane(xy)
     TabCloser("Line plot").put(scrollpane, self)
    def __init__(self, c, parent=None):

        self.c = c
        self.parent = parent
        p = c.currentPosition()
        self.p = p
        self.ignore_insert = 0
        self.pattern = pattern = java.util.regex.Pattern.compile("<" + "<" +
                                                                 "[^<>]*" +
                                                                 ">" + ">")

        self.jtp = jtp = swing.JTextPane()
        #self.jtp.addFocusListener( self )
        jtf = swing.JTextField()
        mlabel = swing.JLabel()
        jp = swing.JPanel(java.awt.BorderLayout())
        jp.add(mlabel, java.awt.BorderLayout.WEST)
        jp.add(jtf, java.awt.BorderLayout.CENTER)

        self.swingmacs = SwingMacs.SwingMacs(jtp, jtf, mlabel, p.c)
        self.swingmacs.kcb.addTabForColon(1)
        self._nodesyncher = self.NodeSyncher(p.copy(), jtp, self.swingmacs,
                                             self)
        doc = jtp.getDocument()
        doc.addDocumentListener(self._nodesyncher)
        bt = p.bodyString()
        if bt == "":
            bt = " "
            p.v.t._bodyString.insert(0, bt)
        self._nodesyncher.ignore = 1
        self.ignore_insert = 1
        jtp.setText(bt)
        self._nodesyncher.ignore = 0
        #s = time.time()
        self.scanNode(p, jtp)
        self.ignore_insert = 0
        #s2 = time.time()
        #print "Time was %s" %( s2 - s )
        jtp.setCaretPosition(0)
        jsp = swing.JScrollPane(jtp)
        if parent:
            parent.add(jsp)
            parent.add(jp, java.awt.BorderLayout.SOUTH)
        else:
            jf = swing.JFrame()
            cp = jf.getContentPane()
            cp.setLayout(java.awt.BorderLayout())
            cp.add(jsp)
            #jtf = swing.JTextField()
            cp.add(jp, java.awt.BorderLayout.SOUTH)
            jf.pack()
            jf.visible = 1

        wm1 = WeakMethod(self, "sync")
        leoPlugins.registerHandler("select1", wm1)
예제 #17
0
 def __init__( self, urlString="" ):
     swing.JFrame.__init__( self, title = "HTML Browser", size = ( 800, 600 ) )
     self.contentPane.layout = java.awt.BorderLayout()
     self.contentPane.add( self.buildTopPane( urlString ), java.awt.BorderLayout.NORTH )
     self.htmlPane = swing.JEditorPane( "text/html", "" , editable = 0, hyperlinkUpdate = self.followHyperlink,
                     size = (400, 400 ) )
     self.contentPane.add( swing.JScrollPane( self.htmlPane ), java.awt.BorderLayout.CENTER )
     self.status = swing.JLabel( " ", preferredSize=(500,20) )
     self.contentPane.add( self.status, java.awt.BorderLayout.SOUTH )
     print self.htmlPane.getContentType()
     print self.htmlPane.getDocument()
예제 #18
0
    def showTrajectory(self):
        table = self.getTableAt(self.getSelectedIndex())
#        colinds=[0,2]
        colinds = [0]+list(table.getSelectedColumns())#w#
        if 2 in colinds: colinds.remove(2)
        model = table.getModel()
        lists =[[model.fields.getOrder()[i] for i in colinds]]#w# get column names
        lists += table.getSelectedLists(colinds)
        xy = GUI.PlotPanel.XYPanelTrajectory(lists)
        scrollpane = swing.JScrollPane(xy)
        TabCloser("Plot trajectory").put(scrollpane, self)
예제 #19
0
    def buildContentPane(self, localVars, globalVars):

        # TODO
        # replace varVal.__class__.__name__ with something more meaningful
        # and scan for things without "__class__" or "__name__" fields
        # some swing components don't have them

        localVarsDict = self.__buildVarDict__(localVars)
        globalVarsDict = self.__buildVarDict__(globalVars)

        localVarsDict = self.filterVars(localVarsDict)
        globalVarsDict = self.filterVars(globalVarsDict)

        localVarsDict = self.sortVars(localVarsDict)
        globalVarsDict = self.sortVars(globalVarsDict)

        localVarsDict = self.improveTypeNames(localVarsDict)
        globalVarsDict = self.improveTypeNames(globalVarsDict)

        #Create the TableModel and JTable components
        localTableModel = swing.table.DefaultTableModel(
            localVarsDict, [
                VAR_L_NAME_COL_CAPTION, VAR_TYPE_COL_CAPTION,
                VAR_VALUE_COL_CAPTION
            ])

        globalTableModel = swing.table.DefaultTableModel(
            globalVarsDict, [
                VAR_G_NAME_COL_CAPTION, VAR_TYPE_COL_CAPTION,
                VAR_VALUE_COL_CAPTION
            ])

        localVarTable = swing.JTable(localTableModel)
        localVarTable.getColumnModel().getColumn(0).setPreferredWidth(1)

        globalVarTable = swing.JTable(globalTableModel)
        globalVarTable.getColumnModel().getColumn(0).setPreferredWidth(1)

        topPane = swing.JScrollPane(localVarTable)
        bottomPane = swing.JScrollPane(globalVarTable)
        return (topPane, bottomPane)
 def __init__(self, debugger):
     swing.JFrame.__init__(self, title='JESDB Variable Watcher')
     # variables correspond to columns on the right
     self.history = ExecHistory(debugger)
     self.controlPanel = DBControlPanel(debugger)
     self.table = swing.JTable(self.history)
     scrollPane = swing.JScrollPane(self.table)
     self.contentPane.setLayout(awt.BorderLayout())
     scrollPane.preferredSize = (200, 400)
     self.contentPane.add(scrollPane, awt.BorderLayout.CENTER)
     self.contentPane.add(self.controlPanel, awt.BorderLayout.EAST)
     self.pack()
    def registerExtenderCallbacks(self, callbacks):
        print "Install Successful...."
        # 测试文本
        testtext = u'''
admin u'\u8fd9\u662f\u4e00\u4e2a\u6d4b\u8bd5\u9875\u9762'
root u'\u4f60\u4ee5\u4e3a\u6709\u91cd\u8981\u4fe1\u606f\u4e48\uff1f'
\u6211\u662F\u4E00\u4E2A\u7C89\u5237\u5320\uFF0C\u7C89\u5237\u672C\u9886\u5F3A\uFF0C
\u6211\u8981\u628A\u90A3\u5C0F\u623F\u5B50\uFF0C\u5237\u7684\u5F88\u6F02\u4EAE\u3002
%u6211%u662F%u4E00%u4E2A%u7C89%u5237%u5320%uFF0C%u7C89%u5237%u672C%u9886%u5F3A%uFF0C
%u6211%u8981%u628A%u90A3%u5C0F%u623F%u5B50%uFF0C%u5237%u7684%u5F88%u6F02%u4EAE%u3002
\x31\x2C\x31\x29\x3B\x75\x70\x64\x61\x74\x65\x20\x5B\x64\x76\x5F\x75\x73\x65\x72\x5D\x20\x73\x65\x74\x20\x75\x73\x65\x72\x67\x72\x6F\x75\x70\x69\x64\x3D\x31\x20\x77\x68\x65\x72\x65\x20\x75\x73\x65\x72\x69\x64\x3D\x32\x3B\x2D\x2D\x20
\x75\x73\x65\x72\x69\x64\x3D\x32\x3B\x2D\x2D\x20
0x310x2C0x310x290x3B0x750x700x640x610x740x650x200x5B0x640x760x5F0x750x730x650x720x5D0x200x730x650x740x200x750x730x650x720x670x720x6F0x750x700x690x640x3D0x310x200x770x680x650x720x650x200x750x730x650x720x690x640x3D0x320x3B0x2D0x2D0x20
0x312C31293B757064617465205B64765F757365725D20736574207573657267726F757069643D31207768657265207573657269643D323B2D2D20
 闲话不说了,base64模块真正用的上的方法只有8个,分别是encode, decode,
 ZW5jb2Rlc3RyaW5n, ZGVjb2Rlc3RyaW5n, YjY0ZW5jb2Rl,b64decode,
  dXJsc2FmZV9iNjRkZWNvZGUsdXJsc2FmZV9iNjRlbmNvZGXjgII=他们8个可以两两分为4组,
  ZW5jb2RlLGRlY29kZQ==一组,专门用来编码和 解码文件的,也可以对StringIO里的数据做编解码;
 ZW5jb2Rlc3RyaW5nLGRlY29kZXN0cmluZw==一组,专门用来编码和解码字符串;
'''
        # 保持对象的引用
        self._callbacks = callbacks
        # 获得扩展辅助对象
        self._helpers = callbacks.getHelpers()
        # 设置Extender里面显示的插件名
        callbacks.setExtensionName("DecodeAssistantDev0.2")
        # 用java的swing库创建一个标签
        self._jPanel = swing.JPanel()
        self._jPanel.setLayout(
            swing.BoxLayout(self._jPanel, swing.BoxLayout.Y_AXIS))
        # 文本框
        self._jTextIn = swing.JTextArea(testtext, 20, 120)
        self._jTextIn.setLineWrap(True)
        self._jScrollPaneIn = swing.JScrollPane(self._jTextIn)
        self._jScrollPaneIn.setVerticalScrollBarPolicy(
            swing.JScrollPane.VERTICAL_SCROLLBAR_ALWAYS)
        self._jScrollPaneIn.setPreferredSize(awt.Dimension(20, 120))
        # 定义2个按钮,编码和解码
        self._jButtonPanel = swing.JPanel()
        self._jButtonEncode = swing.JButton('Encode',
                                            actionPerformed=self.encode)
        self._jButtonDecode = swing.JButton('Decode',
                                            actionPerformed=self.decode)
        self._jButtonPanel.add(self._jButtonEncode)
        self._jButtonPanel.add(self._jButtonDecode)
        self._jPanel.add(self._jScrollPaneIn)
        self._jPanel.add(self._jButtonPanel)

        callbacks.customizeUiComponent(self._jPanel)

        # register ourselves as a message editor tab factory
        callbacks.addSuiteTab(self)
        return
예제 #22
0
    def __init__(self, model, probrecs=None, listener=False):
        GUI.BaseTabs.BaseTabs.__init__(self, listener)
        self.metabolicModel = model
        levelmodels = []
        tables = []
        nlevels = len(model.ClassLevels)
        nlevel = 0
        while nlevel < nlevels:
            theclass = model.getLevelClass(nlevel)
            fields = theclass.fields.copy()
            if nlevel == 0:
                del fields[theclass.ParentField]
            if nlevel == nlevels - 1:
                del fields[theclass.ChildField]
            tm = LevelTable.LevelTableModel(model, theclass, self, nlevel,
                                            fields)
            levelmodels.append(tm)
            if nlevel > 0:
                tm.addTableModelListener(tables[nlevel - 1])
            table = LevelTable.LevelTable(tm)
            tables.append(table)
            scrollpane = swing.JScrollPane(table)

            theclass = self.metabolicModel.getLevelClass(nlevel)
            if theclass == Model.Element.Reaction:
                self.reaclevel = nlevel
            title = "%d %s" % (table.getRowCount(),
                               theclass.__name__.lower() + 's')
            self.addTab(title, scrollpane)
            nlevel += 1
        self.setSelectedIndex(2)

        while nlevel > 0:
            nlevel -= 1
            levelmodels[nlevel - 1].addTableModelListener(tables[nlevel])

        self.problemtable = ProblemTable.ProblemTable()
        if probrecs != None:
            self.problemtable.getModel().addRecords(probrecs)
        self.addTab(PROBLEM, swing.JScrollPane(self.problemtable))
예제 #23
0
 def __init__(self):
     swing.JFrame.__init__(self)
     self.title = 'Chat'
     self.windowClosing = self.onExit
     self.text = swing.JTextArea(editable=0,
                                 lineWrap=1,
                                 wrapStyleWord=1)
     self.contentPane.add(swing.JScrollPane(self.text))
     self.input = swing.JTextField(actionPerformed=self.onEnter)
     self.contentPane.add(self.input, 'South')
     self.size = 300, 200
     self.show()
     self.input.requestFocus()
예제 #24
0
 def reportSolution(self, output):#w#for genome-scale analysis
     sampletabs = swing.JTabbedPane()
     samples, monitors = QSSPN.Table.output2table(output)
     outputtable=[]
     for i in range(len(samples)):
         sample = samples[i]
         table = QSSPNTable(); table.write_output(sample, monitors, 'Output')
         tab = swing.JScrollPane(table)
         sampletabs.addTab('Sample'+str(i+1), tab)
         outputtable+=[table]
     TabCloser('Output').put(sampletabs, self)
     for table in outputtable: table.setColWidths_gsa(self.getWidth())
     if self.listener: self.listener()
예제 #25
0
 def createGui( self ):
     
     
     self.jd = jd = swing.JDialog()
     self.jd.setName( "Leodialog" )
     jd.setTitle( "Libraries" )
     jdc = jd.getContentPane()
     self.libs = lib = swing.JList()
     self.libs.setName( "Autolist" )
     lib.setVisibleRowCount( 5 )
     view = swing.JScrollPane( lib )
     jdc.add( view, awt.BorderLayout.NORTH )
     create = swing.JButton( "Create" )
     create.actionPerformed = self.create
     add = swing.JButton( "Add" )
     add.actionPerformed = self.add 
     move = swing.JButton( "Move" )
     move.actionPerformed = self.move
     remove = swing.JButton( "Remove" )
     remove.actionPerformed = self.remove
     _open = swing.JButton( "Open" )
     _open.actionPerformed = self.open 
     close = swing.JButton( "Close" )
     close.actionPerformed = self.close
     
     topjp = swing.JPanel()
     topjp.setLayout( awt.GridLayout( 2, 1 ) )
     jdc.add( topjp, awt.BorderLayout.SOUTH )
     
     self.message = swing.JTextField()
     mp = swing.JPanel()
     gbl = awt.GridBagLayout()
     mp.setLayout( gbl )
     gbc = awt.GridBagConstraints()
     gbc.weightx = 1.0
     gbc.weighty = 1.0
     gbc.fill = 1
     gbl.setConstraints( self.message, gbc )
     mp.add( self.message )
     
     topjp.add( mp )# , awt.BorderLayout.NORTH )
     
     jp = swing.JPanel()
     jp.setLayout( awt.GridLayout( 1, 6 ) )
     jp.add( create )
     jp.add( add )
     jp.add( move )
     jp.add( remove )
     jp.add( _open )
     jp.add( close )
     topjp.add( jp )#, awt.BorderLayout.SOUTH ) 
예제 #26
0
 def __init__(self, debugger):
     self.debugger = debugger
     self.controlPanel = DBControlPanel(self.debugger)
     self.history = JESExecHistoryModel.JESExecHistoryModel()
     self.table = WatcherTable(self.history)
     self.rendererComponent = swing.JLabel(opaque=1)
     self.table.setDefaultRenderer(Object, MyRenderer())
     self.history.setColumnWidths(self.table)
     self.scrollPane = swing.JScrollPane(self.table)
     self.scrollPane.verticalScrollBar.model.stateChanged = self.stateChanged
     self.setLayout(awt.BorderLayout())
     self.add(self.scrollPane, awt.BorderLayout.CENTER)
     self.add(self.controlPanel, awt.BorderLayout.NORTH)
     self.lastScrollMaximum = None
예제 #27
0
    def __init__(self):
        swing.JFrame.__init__(self)
        self.title='Network Application Organizer'
        self.windowClosing=lambda x: sys.exit()

        self.namePane=swing.JPanel(layout=java.awt.BorderLayout())
        self.namePane.add(swing.JLabel('Name:'),'West')
        self.nameText=swing.JTextField(actionPerformed=self.onTrySetName)
        self.namePane.add(self.nameText)
        self.contentPane.add(self.namePane,'North')

        self.tab=swing.JTabbedPane()
        
        self.runningAppData=RunningAppTableModel()
        self.table=swing.JTable(self.runningAppData)
        self.table.selectionMode=swing.ListSelectionModel.SINGLE_SELECTION
        self.table.preferredScrollableViewportSize=300,50
        self.table.mouseClicked=self.onTableClicked

        self.appTypeList=swing.JList(mouseClicked=self.onTypeListClicked,valueChanged=self.onTypeListSelectionChanged)
        createPane=swing.JPanel(layout=java.awt.BorderLayout())
        createPane.add(swing.JScrollPane(self.appTypeList),'West')
        self.startAppButton=swing.JButton('Start',actionPerformed=self.onStartApp)
        createPane.add(self.startAppButton,'East')

        self.optionPanelLayout=java.awt.CardLayout()
        self.optionPanel=swing.JPanel(layout=self.optionPanelLayout)
        self.optionEditor=swing.JComboBox(font=swing.JTable().font)
        createPane.add(self.optionPanel)

        self.tab.addTab('Start New App',createPane)
        self.tab.addTab('Running Apps',swing.JScrollPane(self.table))

        self.contentPane.add(self.tab)
        
        self.pack()
        self.show()
    def registerExtenderCallbacks(self, callbacks):
        # keep a reference to our callbacks object
        self._callbacks = callbacks
        # obtain an extension helpers object
        self._helpers = callbacks.getHelpers()
        # set out extension name
        self._callbacks.setExtensionName("Polito Inc. :: Request Analytics")

        # create out GUI
        self._jPanel = swing.JPanel()
        mainVerticalBox = swing.Box.createVerticalBox()

        descriptionHorizontalBox = swing.Box.createHorizontalBox()
        descriptionHorizontalBox.add(
            swing.JLabel(
                "<html><br /><br />Request Analytics will track every request made through Burp and track how many times each 'file' appears in only uniqe URIs.<br />Only URIs included in scope will be analyzed.<br /><br /><br /></html>"
            ))
        mainVerticalBox.add(descriptionHorizontalBox)

        controlsHorizontalBox = swing.Box.createHorizontalBox()
        displayAnalyticDataButton = swing.JButton(
            'Display Analytic Data', actionPerformed=self.displayAnalyticData)
        controlsHorizontalBox.add(displayAnalyticDataButton)
        resetAnalyticDataButton = swing.JButton(
            'Reset Analytic Data', actionPerformed=self.resetAnalyticData)
        controlsHorizontalBox.add(resetAnalyticDataButton)
        mainVerticalBox.add(controlsHorizontalBox)

        spacer1HorizontalBox = swing.Box.createHorizontalBox()
        spacer1HorizontalBox.add(
            swing.JLabel("<html><br /><br /><br /></html>"))
        mainVerticalBox.add(spacer1HorizontalBox)

        outputHorizontalBox = swing.Box.createHorizontalBox()
        self._outputTextArea = swing.JTextArea()
        self._outputTextArea.setEditable(False)
        outputTextArea = swing.JScrollPane(self._outputTextArea)
        outputTextArea.setPreferredSize(Dimension(250, 300))
        outputHorizontalBox.add(outputTextArea)
        mainVerticalBox.add(outputHorizontalBox)

        self._jPanel.add(mainVerticalBox)

        # register ourselves as an HTTP listener
        self._callbacks.registerHttpListener(self)
        # add the custom tab to Burp's UI
        self._callbacks.addSuiteTab(self)

        return
예제 #29
0
 def __init__(self, directory):
     swing.JFrame.__init__(self,
                           title="File Contents Viewer",
                           size=(210, 250))
     self.contentPane.layout = java.awt.BorderLayout()
     self.currentDirectory = directory
     self.files = swing.JList(os.listdir(self.currentDirectory))
     pane = swing.JScrollPane(self.files)
     self.contentPane.add(pane, java.awt.BorderLayout.CENTER)
     fileView = swing.JButton("View Contents",
                              size=(65, 30),
                              actionPerformed=self.fileView)
     self.contentPane.add(fileView, java.awt.BorderLayout.SOUTH)
     self.pack()
     self.visible = 1
예제 #30
0
파일: gui.py 프로젝트: kfuruya/ChatClient
    def friendsList(self, username):

        self.window = swing.JFrame(username)
        self.window.layout = awt.BorderLayout()
        statusPanel = swing.JPanel()
        statusPanel.layout = awt.GridLayout(4, 1)

        # Set status placeholder UI
        statusPanel.border = swing.BorderFactory.createTitledBorder("Status")
        buttonGroup = swing.ButtonGroup()
        radioButton = swing.JRadioButton("Away",
                                         actionPerformed=self.radioCallback)
        buttonGroup.add(radioButton)
        statusPanel.add(radioButton)
        radioButton = swing.JRadioButton("Here",
                                         actionPerformed=self.radioCallback)
        buttonGroup.add(radioButton)
        statusPanel.add(radioButton)
        #Wizard of Oz incoming chat request
        radioButton = swing.JButton("Page Boss", actionPerformed=self.callBoss)
        buttonGroup.add(radioButton)
        statusPanel.add(radioButton)
        statusPanel.add(self.status)
        #statusPanel.add(swing.JButton("Update Status", actionPerformed=self.updateStatus))
        #Buddy list
        panel = swing.JPanel()
        panel.layout = awt.BorderLayout()
        panel.border = swing.BorderFactory.createTitledBorder("Friends Online")

        ##TODO: fix threading so that friends load before the window
        print self.friendsData
        self.friendsData.append('guest')
        print '2'

        self.list = swing.JList(self.friendsData)
        panel.add("Center", swing.JScrollPane(self.list))
        launchChatButton = swing.JButton("Launch chat?",
                                         actionPerformed=self.launchChatOut)
        panel.add("South", launchChatButton)
        self.window.windowClosing = self.goodbye
        pane = JScrollPane()
        pane.getViewport().add(self.list)
        panel.add(pane)
        self.window.add("North", statusPanel)
        self.window.add("South", panel)
        self.window.pack()
        self.window.visible = True
        return self.window