Exemplo n.º 1
0
    def initUI(self, config):
        self.setLayout(BoxLayout(self.getContentPane(), BoxLayout.Y_AXIS))
        self.entries = config.keys()
        self.hash4keys = dict()

        self.panelEntries = JPanel()
        self.panelEntries.setLayout(BoxLayout(self.panelEntries,BoxLayout.Y_AXIS))
        self.add(self.panelEntries)

        #buttons
        self.panelButtons = JPanel()
        self.panelButtons.setLayout(BoxLayout(self.panelButtons,BoxLayout.X_AXIS))
        #'Configuration list:')
        self.addB = JButton('Add')
        self.addB.actionPerformed = self.add_entry
        self.removeB = JButton('Remove')
        self.removeB.actionPerformed = self.remove_entry
        self.saveB = JButton('Save')
        self.saveB.actionPerformed = self.save_config
        # pack buttons
        self.add(self.panelButtons)
        self.panelButtons.add(self.addB)
        self.panelButtons.add(self.removeB)
        self.panelButtons.add(self.saveB)

        self.config_item_dict = {}
        self.select_key_rb_group = ButtonGroup()
        self.select_default_rb_group = ButtonGroup()
        for key in self.entries:
            if key == 'default':
                continue
            self.add_UI_entry(key, config[key])
        self.pack()
        self.setLocation(150,150)

        self.setVisible(True)
Exemplo n.º 2
0
    def _create_output_panel(self):
        self.outputPanel = JPanel()
        self.outputEditor = self.callbacks.createTextEditor()
        self.outputEditor.editable = False
        self.outputText = self.outputEditor.component
        self.clearOutputButton = JButton('Clear',
                                         actionPerformed=self.clear_stdout)
        self.outputButtonGroup = ButtonGroup()
        self.outputFileRadioButton = JRadioButton(
            'Save to File:', actionPerformed=self.save_file_output)
        self.outputUIRadioButton = JRadioButton(
            'Show in UI:', selected=True, actionPerformed=self.view_ui_output)
        self.outputFileTextField = JTextField(50,
                                              enabled=False,
                                              disabledTextColor=Color.black)
        self.outputFileBrowseButton = JButton(
            'Browse...', enabled=False, actionPerformed=self.set_output_file)

        self.outputButtonGroup.add(self.outputFileRadioButton)
        self.outputButtonGroup.add(self.outputUIRadioButton)

        outputLayout = GroupLayout(self.outputPanel,
                                   autoCreateGaps=True,
                                   autoCreateContainerGaps=True)
        outputLayout.setHorizontalGroup(
            outputLayout.createParallelGroup().addGroup(
                outputLayout.createSequentialGroup().addComponent(
                    self.outputFileRadioButton).addComponent(
                        self.outputFileTextField, GroupLayout.DEFAULT_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE).addComponent(
                            self.outputFileBrowseButton)).addComponent(
                                self.outputUIRadioButton).addComponent(
                                    self.outputText).addComponent(
                                        self.clearOutputButton))

        outputLayout.setVerticalGroup(
            outputLayout.createSequentialGroup().addGroup(
                outputLayout.createParallelGroup().addComponent(
                    self.outputFileRadioButton).addComponent(
                        self.outputFileTextField, GroupLayout.DEFAULT_SIZE,
                        GroupLayout.DEFAULT_SIZE,
                        GroupLayout.PREFERRED_SIZE).addComponent(
                            self.outputFileBrowseButton)).addComponent(
                                self.outputUIRadioButton).addComponent(
                                    self.outputText).addComponent(
                                        self.clearOutputButton))
        self.outputPanel.layout = outputLayout
Exemplo n.º 3
0
    def __init__( self, outer ) :
        InternalFrame.__init__(
            self,
            'RadioButtons',
            outer,
            size = ( 400, 85 ),
            location = Point( 5, 225 )
        )

        self.add( JLabel( 'Timeout (minutes):' ) )
        buttons = {}
        self.bg = ButtonGroup()
        for name in '0,15,30,60,Other'.split( ',' ) :
            button = JRadioButton(
                name,
                itemStateChanged = self.stateChange
            )
            self.bg.add( button )
            self.add( button )
            buttons[ name ] = button
        
        self.r00  = buttons[ '0'  ]
        self.r15  = buttons[ '15' ]
        self.r30  = buttons[ '30' ]
        self.r60  = buttons[ '60' ]
        self.rot  = buttons[ 'Other' ]

        self.text = self.add( 
            JTextField(
                '',
                3,
                actionPerformed = outer.update
            )
        )
        self.message = self.add( JLabel() )

        self.setting = 0         # see stateChange() and setValue()

        self.setVisible( 1 )
Exemplo n.º 4
0
  def initComponents(self):
    dialogTitle = "_Select_folder"
    fileChooserID = "idPathGMLSelector"
    seticon = True
    # Init
    ## Button group
    self.btgOptions = ButtonGroup()
    self.btgOptions.add(self.rdbOption1)
    self.btgOptions.add(self.rdbOption2)
    self.btgOptions.add(self.rdbOption3)
    ## Image format
    self.cmbImageFormat.addItem("PNG")
    self.cmbImageFormat.addItem("JPEG")
    self.cmbImageFormat.addItem("GIF")
    ## Pickers
    ### Field with image data
    swm = DALSwingLocator.getSwingManager()
    self.pickerFieldsImageData = swm.createAttributeDescriptorPickerController(self.cmbImageField)
    self.pickerFieldsPath = swm.createAttributeDescriptorPickerController(self.cmbPathField)
    self.pickerFieldsName = swm.createAttributeDescriptorPickerController(self.cmbPathFieldName)
    self.pickerFolder = ToolsSwingLocator.getToolsSwingManager().createFolderPickerController(
       self.txtPath,
       self.btnPath)
    
    eesmanager = ExpressionEvaluatorSwingLocator.getManager()
    self.pickerExp = eesmanager.createExpressionPickerController(self.txtExp, self.btnExp)

    self.pickerExpStore= swm.createFeatureStoreElement(self.store)
    self.pickerExp.addElement(self.pickerExpStore)
    # Input
    ## Layer
    allDocuments = self.getAllValidDocuments()
    if len(allDocuments)==0:
      logger("Not able to find 2 tables to execute the tool", LOGGER_INFO)
      return
    else:
      self._updateAllUI()
Exemplo n.º 5
0
    def createMenuBar(self):
        menuBar = JMenuBar()

        fileMenu = JMenu('File')
        exitItem = fileMenu.add(
            JMenuItem('Exit',
                      KeyEvent.VK_X,
                      actionPerformed=self.exit,
                      accelerator=KeyStroke.getKeyStroke(
                          KeyEvent.VK_X, ActionEvent.ALT_MASK)))
        menuBar.add(fileMenu)

        codeMenu = JMenu('Encoding')

        data = [['ANSI', KeyEvent.VK_A], ['UTF-8', KeyEvent.VK_U],
                ['UCS-2 Big Endian', KeyEvent.VK_B],
                ['UCS-2 Little Endian', KeyEvent.VK_L]]

        bGroup = ButtonGroup()
        for suffix, mnemonic in data:
            name = 'Encoding in ' + suffix
            rb = JRadioButtonMenuItem(name,
                                      mnemonic=mnemonic,
                                      selected=(suffix == 'ANSI'))
            bGroup.add(rb)
            codeMenu.add(rb)
        menuBar.add(codeMenu)

        viewMenu = JMenu('View')
        viewMenu.add(JCheckBoxMenuItem('Full screen'))
        viewMenu.add(JSeparator())  # Using JSeparator()
        #       viewMenu.addSeparator()        # Using addSeparator()
        #       viewMenu.insertSeparator( 1 )  #
        viewMenu.add(JCheckBoxMenuItem('Word wrap'))
        menuBar.add(viewMenu)

        return menuBar
    def initGui(self):
        #~ if DEBUG:
        #~ import pdb;
        #~ pdb.set_trace()
        tabPane = JTabbedPane(JTabbedPane.TOP)
        CreditsText = "<html># Burp Custom Deserializer<br/># Copyright (c) 2016, Marco Tinari<br/>#<br/># This program is free software: you can redistribute it and/or modify<br/># it under the terms of the GNU General Public License as published by<br/># the Free Software Foundation, either version 3 of the License, or<br/># (at your option) any later version.<br/>#<br/># This program is distributed in the hope that it will be useful,<br/># but WITHOUT ANY WARRANTY; without even the implied warranty of<br/># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br/># GNU General Public License for more details.<br/>#<br/># You should have received a copy of the GNU General Public License<br/># along with this program.  If not, see <http://www.gnu.org/licenses/>.)<br/></html>"
        label1 = JLabel(
            "<html>Usage:<br>1 - Select the desired encoding functions<br>2 - Enter the name of the parameter in the input field below and press the Apply button!</html>"
        )
        label2 = JLabel(CreditsText)
        panel1 = JPanel()
        #set layout
        panel1.setLayout(GridLayout(11, 1))
        panel2 = JPanel()
        panel1.add(label1)
        panel2.add(label2)
        tabPane.addTab("Configuration", panel1)
        tabPane.addTab("Credits", panel2)

        applyButton = JButton('Apply', actionPerformed=self.reloadConf)
        panel1.add(applyButton, BorderLayout.SOUTH)

        #define GET/POST/COOKIE radio button
        self.GETparameterTypeRadioButton = JRadioButton('GET parameter')
        self.POSTparameterTypeRadioButton = JRadioButton('POST parameter')
        self.COOKIEparameterTypeRadioButton = JRadioButton('COOKIE parameter')
        self.POSTparameterTypeRadioButton.setSelected(True)
        group = ButtonGroup()
        group.add(self.GETparameterTypeRadioButton)
        group.add(self.POSTparameterTypeRadioButton)
        group.add(self.COOKIEparameterTypeRadioButton)
        self.base64Enabled = JCheckBox("Base64 encode")
        self.URLEnabled = JCheckBox("URL encode")
        self.ASCII2HexEnabled = JCheckBox("ASCII to Hex")
        self.ScannerEnabled = JCheckBox(
            "<html>Enable serialization in Burp Scanner<br>Usage:<br>1.Place unencoded values inside intruder request and define the placeholder positions<br>2.rightclick->Actively scan defined insertion points)</html>"
        )
        self.IntruderEnabled = JCheckBox(
            "<html>Enable serialization in Burp Intruder<br>Usage:<br>1.Place unencoded values inside intruder request and define the placeholder positions<br>2.Start the attack</html>"
        )
        self.parameterName = JTextField("Parameter name goes here...", 60)

        #set the tooltips
        self.parameterName.setToolTipText(
            "Fill in the parameter name and apply")
        self.base64Enabled.setToolTipText("Enable base64 encoding/decoding")
        self.ASCII2HexEnabled.setToolTipText(
            "Enable ASCII 2 Hex encoding/decoding")
        self.URLEnabled.setToolTipText("Enable URL encoding/decoding")
        self.IntruderEnabled.setToolTipText(
            "Check this if You want the extension to intercept and modify every request made by the Burp Intruder containing the selected paramter"
        )
        self.ScannerEnabled.setToolTipText(
            "Check this if You want the extension to intercept and modify every request made by the Burp Scanner containing the selected paramter"
        )

        #add checkboxes to the panel
        panel1.add(self.parameterName)
        panel1.add(self.POSTparameterTypeRadioButton)
        panel1.add(self.GETparameterTypeRadioButton)
        panel1.add(self.COOKIEparameterTypeRadioButton)
        panel1.add(self.base64Enabled)
        panel1.add(self.URLEnabled)
        panel1.add(self.ASCII2HexEnabled)
        panel1.add(self.IntruderEnabled)
        panel1.add(self.ScannerEnabled)
        #assign tabPane
        self.tab = tabPane
Exemplo n.º 7
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Label_1 = JLabel("Plaso Executable Directory")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Program_Executable_TF = JTextField(20)
        self.Program_Executable_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Program_Executable_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Program_Executable_TF)

        self.Find_Program_Exec_BTN = JButton(
            "Find Dir", actionPerformed=self.Find_Plaso_Dir)
        self.Find_Program_Exec_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Find_Program_Exec_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Program_Exec_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.Find_Program_Exec_BTN)

        self.Blank_1 = JLabel(" ")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_1, self.gbcPanel0)
        self.panel0.add(self.Blank_1)

        self.Save_Settings_BTN = JButton("Save Plaso Exec Dir",
                                         actionPerformed=self.SaveSettings)
        self.Save_Settings_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Save_Settings_BTN)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Save_Settings_BTN, self.gbcPanel0)
        self.panel0.add(self.Save_Settings_BTN)

        self.Blank_2 = JLabel(" ")
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_2, self.gbcPanel0)
        self.panel0.add(self.Blank_2)

        self.Label_1 = JLabel("Plaso Storage File")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Plaso_Storage_File_TF = JTextField(20)
        self.Plaso_Storage_File_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 13
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Plaso_Storage_File_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Plaso_Storage_File_TF)

        self.Find_Storage_BTN = JButton("Find Storage File",
                                        actionPerformed=self.Find_Plaso_File)
        self.Find_Storage_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Find_Storage_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 13
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Storage_BTN, self.gbcPanel0)
        self.panel0.add(self.Find_Storage_BTN)

        self.Blank_3 = JLabel(" ")
        self.Blank_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_3, self.gbcPanel0)
        self.panel0.add(self.Blank_3)

        self.Exclude_File_Sources_CB = JCheckBox(
            "Exclude File Source", actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 17
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Exclude_File_Sources_CB,
                                     self.gbcPanel0)
        self.panel0.add(self.Exclude_File_Sources_CB)

        self.Blank_4 = JLabel(" ")
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_4, self.gbcPanel0)
        self.panel0.add(self.Blank_4)

        self.Label_3 = JLabel("Message:")
        self.Label_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 21
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_3, self.gbcPanel0)
        self.panel0.add(self.Label_3)

        self.Error_Message = JLabel("")
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 23
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Error_Message, self.gbcPanel0)
        self.panel0.add(self.Error_Message)

        self.add(self.panel0)
Exemplo n.º 8
0
    def __init__(self, app):
        from java.awt import Dialog
        from java.awt import CardLayout
        JDialog.__init__(self,
                         app.preferencesFrame,
                         app.strings.getString("Create_a_new_favourite_zone"),
                         Dialog.ModalityType.DOCUMENT_MODAL)
        self.app = app
        border = BorderFactory.createEmptyBorder(5, 7, 7, 7)
        self.getContentPane().setBorder(border)
        self.setLayout(BoxLayout(self.getContentPane(), BoxLayout.Y_AXIS))

        self.FAVAREALAYERNAME = "Favourite zone editing"

        info = JLabel(self.app.strings.getString("Create_a_new_favourite_zone"))
        info.setAlignmentX(Component.LEFT_ALIGNMENT)

        #Name
        nameLbl = JLabel(self.app.strings.getString("fav_zone_name"))
        self.nameTextField = JTextField(20)
        self.nameTextField.setMaximumSize(self.nameTextField.getPreferredSize())
        self.nameTextField.setToolTipText(self.app.strings.getString("fav_zone_name_tooltip"))
        namePanel = JPanel()
        namePanel.setLayout(BoxLayout(namePanel, BoxLayout.X_AXIS))
        namePanel.add(nameLbl)
        namePanel.add(Box.createHorizontalGlue())
        namePanel.add(self.nameTextField)

        #Country
        countryLbl = JLabel(self.app.strings.getString("fav_zone_country"))
        self.countryTextField = JTextField(20)
        self.countryTextField.setMaximumSize(self.countryTextField.getPreferredSize())
        self.countryTextField.setToolTipText(self.app.strings.getString("fav_zone_country_tooltip"))
        countryPanel = JPanel()
        countryPanel.setLayout(BoxLayout(countryPanel, BoxLayout.X_AXIS))
        countryPanel.add(countryLbl)
        countryPanel.add(Box.createHorizontalGlue())
        countryPanel.add(self.countryTextField)

        #Type
        modeLbl = JLabel(self.app.strings.getString("fav_zone_type"))
        RECTPANEL = "rectangle"
        POLYGONPANEL = "polygon"
        BOUNDARYPANEL = "boundary"
        self.modesStrings = [RECTPANEL, POLYGONPANEL, BOUNDARYPANEL]
        modesComboModel = DefaultComboBoxModel()
        for i in (self.app.strings.getString("rectangle"),
                  self.app.strings.getString("delimited_by_a_closed_way"),
                  self.app.strings.getString("delimited_by_an_administrative_boundary")):
            modesComboModel.addElement(i)
        self.modesComboBox = JComboBox(modesComboModel,
                                       actionListener=self,
                                       editable=False)

        #- Rectangle
        self.rectPanel = JPanel()
        self.rectPanel.setLayout(BoxLayout(self.rectPanel, BoxLayout.Y_AXIS))

        capturePane = JPanel()
        capturePane.setLayout(BoxLayout(capturePane, BoxLayout.X_AXIS))
        capturePane.setAlignmentX(Component.LEFT_ALIGNMENT)

        josmP = JPanel()
        self.captureRBtn = JRadioButton(self.app.strings.getString("capture_area"))
        self.captureRBtn.addActionListener(self)
        self.captureRBtn.setSelected(True)
        self.bboxFromJosmBtn = JButton(self.app.strings.getString("get_current_area"),
                                       actionPerformed=self.on_bboxFromJosmBtn_clicked)
        self.bboxFromJosmBtn.setToolTipText(self.app.strings.getString("get_capture_area_tooltip"))
        josmP.add(self.bboxFromJosmBtn)
        capturePane.add(self.captureRBtn)
        capturePane.add(Box.createHorizontalGlue())
        capturePane.add(self.bboxFromJosmBtn)

        manualPane = JPanel()
        manualPane.setLayout(BoxLayout(manualPane, BoxLayout.X_AXIS))
        manualPane.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.manualRBtn = JRadioButton(self.app.strings.getString("use_this_bbox"))
        self.manualRBtn.addActionListener(self)
        self.bboxTextField = JTextField(20)
        self.bboxTextField.setMaximumSize(self.bboxTextField.getPreferredSize())
        self.bboxTextField.setToolTipText(self.app.strings.getString("fav_bbox_tooltip"))
        self.bboxTextFieldDefaultBorder = self.bboxTextField.getBorder()
        self.bboxTextField.getDocument().addDocumentListener(TextListener(self))
        manualPane.add(self.manualRBtn)
        manualPane.add(Box.createHorizontalGlue())
        manualPane.add(self.bboxTextField)

        group = ButtonGroup()
        group.add(self.captureRBtn)
        group.add(self.manualRBtn)

        previewPane = JPanel()
        previewPane.setLayout(BoxLayout(previewPane, BoxLayout.X_AXIS))
        previewPane.setAlignmentX(Component.LEFT_ALIGNMENT)
        bboxPreviewInfo = JTextField(self.app.strings.getString("coordinates"),
                                     editable=0,
                                     border=None)
        bboxPreviewInfo.setMaximumSize(bboxPreviewInfo.getPreferredSize())
        self.bboxPreviewTextField = JTextField(20,
                                               editable=0,
                                               border=None)
        self.bboxPreviewTextField.setMaximumSize(self.bboxPreviewTextField.getPreferredSize())
        previewPane.add(bboxPreviewInfo)
        previewPane.add(Box.createHorizontalGlue())
        previewPane.add(self.bboxPreviewTextField)

        self.rectPanel.add(capturePane)
        self.rectPanel.add(Box.createRigidArea(Dimension(0, 10)))
        self.rectPanel.add(manualPane)
        self.rectPanel.add(Box.createRigidArea(Dimension(0, 20)))
        self.rectPanel.add(previewPane)

        #- Polygon (closed way) drawn by hand
        self.polygonPanel = JPanel(BorderLayout())
        self.polygonPanel.setLayout(BoxLayout(self.polygonPanel, BoxLayout.Y_AXIS))

        polyInfo = JLabel("<html>%s</html>" % self.app.strings.getString("polygon_info"))
        polyInfo.setFont(polyInfo.getFont().deriveFont(Font.ITALIC))
        polyInfo.setAlignmentX(Component.LEFT_ALIGNMENT)

        editPolyPane = JPanel()
        editPolyPane.setAlignmentX(Component.LEFT_ALIGNMENT)
        editPolyBtn = JButton(self.app.strings.getString("create_fav_layer"),
                              actionPerformed=self.create_new_zone_editing_layer)
        editPolyBtn.setToolTipText(self.app.strings.getString("create_fav_layer_tooltip"))
        editPolyPane.add(editPolyBtn)

        self.polygonPanel.add(polyInfo)
        self.polygonPanel.add(Box.createRigidArea(Dimension(0, 15)))
        self.polygonPanel.add(editPolyPane)
        self.polygonPanel.add(Box.createRigidArea(Dimension(0, 15)))

        #- Administrative Boundary
        self.boundaryPanel = JPanel()
        self.boundaryPanel.setLayout(BoxLayout(self.boundaryPanel, BoxLayout.Y_AXIS))

        boundaryInfo = JLabel("<html>%s</html>" % app.strings.getString("boundary_info"))
        boundaryInfo.setFont(boundaryInfo.getFont().deriveFont(Font.ITALIC))
        boundaryInfo.setAlignmentX(Component.LEFT_ALIGNMENT)

        boundaryTagsPanel = JPanel(GridLayout(3, 3, 5, 5))
        boundaryTagsPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        boundaryTagsPanel.add(JLabel("name ="))
        self.nameTagTextField = JTextField(20)
        boundaryTagsPanel.add(self.nameTagTextField)
        boundaryTagsPanel.add(UrlLabel("http://wiki.openstreetmap.org/wiki/Key:admin_level#admin_level", "admin_level ="))
        self.adminLevelTagTextField = JTextField(20)
        self.adminLevelTagTextField.setToolTipText(self.app.strings.getString("adminLevel_tooltip"))
        boundaryTagsPanel.add(self.adminLevelTagTextField)
        boundaryTagsPanel.add(JLabel(self.app.strings.getString("other_tag")))
        self.optionalTagTextField = JTextField(20)
        self.optionalTagTextField.setToolTipText("key=value")
        boundaryTagsPanel.add(self.optionalTagTextField)

        downloadBoundariesPane = JPanel()
        downloadBoundariesPane.setAlignmentX(Component.LEFT_ALIGNMENT)
        downloadBoundariesBtn = JButton(self.app.strings.getString("download_boundary"),
                                        actionPerformed=self.on_downloadBoundariesBtn_clicked)
        downloadBoundariesBtn.setToolTipText(self.app.strings.getString("download_boundary_tooltip"))
        downloadBoundariesPane.add(downloadBoundariesBtn)

        self.boundaryPanel.add(boundaryInfo)
        self.boundaryPanel.add(Box.createRigidArea(Dimension(0, 15)))
        self.boundaryPanel.add(boundaryTagsPanel)
        self.boundaryPanel.add(Box.createRigidArea(Dimension(0, 10)))
        self.boundaryPanel.add(downloadBoundariesPane)

        self.editingPanels = {"rectangle": self.rectPanel,
                              "polygon": self.polygonPanel,
                              "boundary": self.boundaryPanel}

        #Main buttons
        self.okBtn = JButton(self.app.strings.getString("OK"),
                             ImageProvider.get("ok"),
                             actionPerformed=self.on_okBtn_clicked)
        self.cancelBtn = JButton(self.app.strings.getString("cancel"),
                                 ImageProvider.get("cancel"),
                                 actionPerformed=self.close_dialog)
        self.previewBtn = JButton(self.app.strings.getString("Preview_zone"),
                                  actionPerformed=self.on_previewBtn_clicked)
        self.previewBtn.setToolTipText(self.app.strings.getString("preview_zone_tooltip"))
        okBtnSize = self.okBtn.getPreferredSize()
        viewBtnSize = self.previewBtn.getPreferredSize()
        viewBtnSize.height = okBtnSize.height
        self.previewBtn.setPreferredSize(viewBtnSize)

        #layout
        self.add(info)
        self.add(Box.createRigidArea(Dimension(0, 15)))

        namePanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.add(namePanel)
        self.add(Box.createRigidArea(Dimension(0, 15)))

        countryPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.add(countryPanel)
        self.add(Box.createRigidArea(Dimension(0, 15)))

        modeLbl.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.add(modeLbl)
        self.add(Box.createRigidArea(Dimension(0, 5)))

        self.add(self.modesComboBox)
        self.modesComboBox.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.add(Box.createRigidArea(Dimension(0, 15)))

        self.configPanel = JPanel(CardLayout())
        self.configPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5))
        self.configPanel.add(self.rectPanel, RECTPANEL)
        self.configPanel.add(self.polygonPanel, POLYGONPANEL)
        self.configPanel.add(self.boundaryPanel, BOUNDARYPANEL)
        self.configPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.add(self.configPanel)
        buttonsPanel = JPanel()
        buttonsPanel.add(self.okBtn)
        buttonsPanel.add(self.cancelBtn)
        buttonsPanel.add(self.previewBtn)
        buttonsPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.add(buttonsPanel)

        self.addWindowListener(self)
        self.pack()
Exemplo n.º 9
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.All_Artifacts_CB = JCheckBox("Remove All Custom Artifacts",
                                          actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.All_Artifacts_CB, self.gbcPanel0)
        self.panel0.add(self.All_Artifacts_CB)

        self.All_Attributes_CB = JCheckBox("Remove All Custom Attributes",
                                           actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.All_Attributes_CB, self.gbcPanel0)
        self.panel0.add(self.All_Attributes_CB)

        self.Blank_0 = JLabel(" ")
        self.Blank_0.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_0, self.gbcPanel0)
        self.panel0.add(self.Blank_0)

        self.Label_0 = JLabel("Remove selected Artifacts")
        self.Label_0.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_0, self.gbcPanel0)
        self.panel0.add(self.Label_0)

        self.Blank_0 = JLabel(" ")
        self.Blank_0.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_0, self.gbcPanel0)
        self.panel0.add(self.Blank_0)

        self.get_artifacts()
        self.List_Box_LB = JList(self.artifact_list,
                                 valueChanged=self.onchange_lb)
        self.List_Box_LB.setVisibleRowCount(3)
        self.scpList_Box_LB = JScrollPane(self.List_Box_LB)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 1
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.scpList_Box_LB, self.gbcPanel0)
        self.panel0.add(self.scpList_Box_LB)

        self.Blank_1 = JLabel(" ")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_1, self.gbcPanel0)
        self.panel0.add(self.Blank_1)

        self.Label_1 = JLabel("Message:")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Blank_2 = JLabel(" ")
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 13
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_2, self.gbcPanel0)
        self.panel0.add(self.Blank_2)

        self.Error_Message = JLabel(
            "For developer purposes only, it may fubar your case")
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Error_Message, self.gbcPanel0)
        self.panel0.add(self.Error_Message)

        self.add(self.panel0)
Exemplo n.º 10
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup() 
        self.gbPanel0 = GridBagLayout() 
        self.gbcPanel0 = GridBagConstraints() 
        self.panel0.setLayout( self.gbPanel0 ) 

        self.Label_1 = JLabel("Protocol:")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 1 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_1, self.gbcPanel0 ) 
        self.panel0.add( self.Label_1 ) 

        self.Protocol_TF = JTextField(20) 
        self.Protocol_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 1 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Protocol_TF, self.gbcPanel0 ) 
        self.panel0.add( self.Protocol_TF ) 

        self.Blank_1 = JLabel( " ") 
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_1, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_1 ) 

        self.Label_2 = JLabel("Cuckoo IP Address")
        self.Label_2.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 5 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_2, self.gbcPanel0 ) 
        self.panel0.add( self.Label_2 ) 

        self.IP_Address_TF = JTextField(20) 
        self.IP_Address_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 5 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.IP_Address_TF, self.gbcPanel0 ) 
        self.panel0.add( self.IP_Address_TF ) 

        self.Blank_2 = JLabel( " ") 
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_2, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_2 ) 

        self.Label_3 = JLabel("Port Number")
        self.Label_3.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 9 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_3, self.gbcPanel0 ) 
        self.panel0.add( self.Label_3 ) 

        self.Port_Number_TF = JTextField(20) 
        self.Port_Number_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 9 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Port_Number_TF, self.gbcPanel0 ) 
        self.panel0.add( self.Port_Number_TF ) 

        self.Blank_3 = JLabel( " ") 
        self.Blank_3.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_3, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_3 ) 

        
        self.Save_Settings_BTN = JButton( "Save Setup", actionPerformed=self.SaveSettings) 
        self.Save_Settings_BTN.setEnabled(True)
        self.rbgPanel0.add( self.Save_Settings_BTN ) 
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 13
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Save_Settings_BTN, self.gbcPanel0 ) 
        self.panel0.add( self.Save_Settings_BTN ) 

        self.Blank_4 = JLabel( " ") 
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_4, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_4 ) 

        self.Blank_5 = JLabel( "Tag to Choose: ") 
        self.Blank_5.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 17
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_5, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_5 ) 

        self.find_tags()
        self.List_Box_LB = JList( self.tag_list, valueChanged=self.onchange_lb)
        self.List_Box_LB.setVisibleRowCount( 3 ) 
        self.scpList_Box_LB = JScrollPane( self.List_Box_LB ) 
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 17 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 1 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.scpList_Box_LB, self.gbcPanel0 ) 
        self.panel0.add( self.scpList_Box_LB ) 

        self.Blank_6 = JLabel( " ") 
        self.Blank_6.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_6, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_6 ) 

        self.Submit_File_CB = JCheckBox("Submit a File", actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 21 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Submit_File_CB, self.gbcPanel0 ) 
        self.panel0.add( self.Submit_File_CB ) 

        # self.Submit_URL_CB = JCheckBox("Submit a URL", actionPerformed=self.checkBoxEvent)
        # self.gbcPanel0.gridx = 2 
        # self.gbcPanel0.gridy = 23 
        # self.gbcPanel0.gridwidth = 1 
        # self.gbcPanel0.gridheight = 1 
        # self.gbcPanel0.fill = GridBagConstraints.BOTH 
        # self.gbcPanel0.weightx = 1 
        # self.gbcPanel0.weighty = 0 
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        # self.gbPanel0.setConstraints( self.Submit_URL_CB, self.gbcPanel0 ) 
        # self.panel0.add( self.Submit_URL_CB ) 

        self.Check_Server_Status_BTN = JButton( "Check Server Status", actionPerformed=self.Check_Server) 
        self.Check_Server_Status_BTN.setEnabled(True)
        self.rbgPanel0.add( self.Save_Settings_BTN ) 
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 25
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Check_Server_Status_BTN, self.gbcPanel0 ) 
        self.panel0.add( self.Check_Server_Status_BTN ) 

        self.Error_Message = JLabel( "") 
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 27
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints( self.Error_Message, self.gbcPanel0 ) 
        self.panel0.add( self.Error_Message ) 


        self.add(self.panel0)
Exemplo n.º 11
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup() 
        self.gbPanel0 = GridBagLayout() 
        self.gbcPanel0 = GridBagConstraints() 
        self.panel0.setLayout( self.gbPanel0 ) 

        self.Label_1 = JLabel("MD5 Hash Value To Verify")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 1 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_1, self.gbcPanel0 ) 
        self.panel0.add( self.Label_1 ) 

        self.MD5HashValue_TF = JTextField(20, focusLost=self.keyPressedMD5) 
        self.MD5HashValue_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 3 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.MD5HashValue_TF, self.gbcPanel0 ) 
        self.panel0.add( self.MD5HashValue_TF ) 

        self.Blank_1 = JLabel( " ") 
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_1, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_1 ) 

        self.Label_2 = JLabel("SHA1 Hash Value To Verify")
        self.Label_2.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 7 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_2, self.gbcPanel0 ) 
        self.panel0.add( self.Label_2 ) 

        self.SHA1HashValue_TF = JTextField(20, focusLost=self.keyPressedSHA1) 
        self.SHA1HashValue_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 9 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.SHA1HashValue_TF, self.gbcPanel0 ) 
        self.panel0.add( self.SHA1HashValue_TF ) 

        self.Blank_2 = JLabel( " ") 
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_1, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_1 ) 

        self.Label_3 = JLabel("FTK Log File")
        self.Label_3.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 13 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_3, self.gbcPanel0 ) 
        self.panel0.add( self.Label_3 ) 

        self.FTKLogFile_TF = JTextField(20) 
        self.FTKLogFile_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 15 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.FTKLogFile_TF, self.gbcPanel0 ) 
        self.panel0.add( self.FTKLogFile_TF ) 

        self.FTKLogFile_BTN = JButton( "Find File", actionPerformed=self.FindFTKTxtFile)
        self.FTKLogFile_BTN.setEnabled(True)
        self.rbgPanel0.add( self.FTKLogFile_BTN ) 
        self.gbcPanel0.gridx = 6 
        self.gbcPanel0.gridy = 15 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.FTKLogFile_BTN, self.gbcPanel0 ) 
        self.panel0.add( self.FTKLogFile_BTN ) 

        self.Label_4 = JLabel( "Message:") 
        self.Label_4.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 29
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_4, self.gbcPanel0 ) 
        self.panel0.add( self.Label_4 ) 
		
        self.Error_Message = JLabel( "") 
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 31
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints( self.Error_Message, self.gbcPanel0 ) 
        self.panel0.add( self.Error_Message ) 

        self.add(self.panel0)
Exemplo n.º 12
0
    def launchGui(self, caller):
      self._stdout = PrintWriter(self._callbacks.getStdout(), True)
      self._stdout.println('Launching gui')
      callMessage = caller.getSelectedMessages()
      self.msg1 = callMessage[0]

      #setup frame
      self.frame = JFrame('Create Issue', windowClosing=self.closeUI)
      Border = BorderFactory.createLineBorder(Color.BLACK)

      #create split panel to add issue panel and template panel
      self.splitPane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
      self.frame.add(self.splitPane)

      #panel setup and add to splitPane
      self.issuePanel = JPanel(GridLayout(0,2))
      self.splitPane.setLeftComponent(self.issuePanel)

      #setup issue name text fields to add to panel
      self.issueNameField = JTextField('',15)
      self.issueNameLabel = JLabel("IssueName:", SwingConstants.CENTER)
      self.issuePanel.add(self.issueNameLabel)
      self.issuePanel.add(self.issueNameField)

      #add issue detail text area
      self.issueDetailField = JTextArea()
      self.issueDetailField.editable = True
      self.issueDetailField.wrapStyleWord = True
      self.issueDetailField.lineWrap = True
      self.issueDetailField.alignmentX = Component.LEFT_ALIGNMENT
      self.issueDetailField.size = (200, 20)
      self.issueDetailField.setBorder(Border)
      self.idfSp = JScrollPane()
      self.idfSp.getViewport().setView((self.issueDetailField))
      self.issuePanel.add(JLabel("Issue Detail:", SwingConstants.CENTER))
      self.issuePanel.add(self.idfSp)

      self.issueBackgroundField= JTextArea()
      self.issueBackgroundField.editable = True
      self.issueBackgroundField.wrapStyleWord = True
      self.issueBackgroundField.lineWrap = True
      self.issueBackgroundField.alignmentX = Component.LEFT_ALIGNMENT
      self.issueBackgroundField.size = (200, 20)
      self.issueBackgroundField.setBorder(Border)
      self.ibfSp = JScrollPane()
      self.ibfSp.getViewport().setView((self.issueBackgroundField))
      self.issuePanel.add(JLabel("Issue Background:", SwingConstants.CENTER))
      self.issuePanel.add(self.ibfSp)

      #add remediation detail text area
      self.remediationDetailField = JTextArea()
      self.remediationDetailField.editable = True
      self.remediationDetailField.wrapStyleWord = True
      self.remediationDetailField.lineWrap = True
      self.remediationDetailField.alignmentX = Component.LEFT_ALIGNMENT
      self.remediationDetailField.size = (200, 20)
      self.remediationDetailField.setBorder(Border)
      self.rdfSp = JScrollPane()
      self.rdfSp.getViewport().setView((self.remediationDetailField))
      self.issuePanel.add(JLabel("Remediation Detail:", SwingConstants.CENTER))
      self.issuePanel.add(self.rdfSp)

      self.remediationBackgroundField= JTextArea()
      self.remediationBackgroundField.editable = True
      self.remediationBackgroundField.wrapStyleWord = True
      self.remediationBackgroundField.lineWrap = True
      self.remediationBackgroundField.alignmentX = Component.LEFT_ALIGNMENT
      self.remediationBackgroundField.size = (200, 20)
      self.remediationBackgroundField.setBorder(Border)
      self.rbfSp = JScrollPane()
      self.rbfSp.getViewport().setView((self.remediationBackgroundField))
      self.issuePanel.add(JLabel("Remediation Background:", SwingConstants.CENTER))
      self.issuePanel.add(self.rbfSp)

      #add radio buttons for severity
      self.radioBtnSevHigh = JRadioButton('High', actionPerformed=None)
      self.radioBtnSevMedium = JRadioButton('Medium', actionPerformed=None)
      self.radioBtnSevLow = JRadioButton('Low', actionPerformed=None)
      severityButtonGroup = ButtonGroup()
      severityButtonGroup.add(self.radioBtnSevHigh)
      severityButtonGroup.add(self.radioBtnSevMedium)
      severityButtonGroup.add(self.radioBtnSevLow)
      self.radioBtnSevHigh.setSelected(True)
      self.issuePanel.add(JLabel("Severity:", SwingConstants.CENTER))
      self.issuePanel.add(self.radioBtnSevHigh)
      self.issuePanel.add(self.radioBtnSevMedium)
      self.issuePanel.add(self.radioBtnSevLow)
    
      self.reqPattern = JTextField('',15)
      self.issuePanel.add(JLabel("Mark Pattern in Request:", SwingConstants.CENTER))
      self.issuePanel.add(self.reqPattern)
      self.resPattern = JTextField('',15)
      self.issuePanel.add(JLabel("Mark Pattern in Response:", SwingConstants.CENTER))
      self.issuePanel.add(self.resPattern)

      #add a button
      self.issueButton = JButton('Add!', actionPerformed=lambda x, m=self.msg1: self.logScanIssue(m))
      self.issuePanel.add(self.issueButton)

      #template panel setup
      self.templatePanel = JPanel(GridLayout(1,2))
      self.splitPane.setRightComponent(self.templatePanel)
    
      #add a list of templates
      self.templatePanel.add(JLabel("Select from Templates", SwingConstants.CENTER))
      self.templateData = tuple(self.tmpl.keys())
      self.templateList = JList(self.templateData)
      self.templateScrollPane = JScrollPane()

      #self.templateScrollPane.setPreferredSize(Dimension(100,125))
      self.templateScrollPane.getViewport().setView((self.templateList))
      self.templatePanel.add(self.templateScrollPane)
      self.templateButton = JButton('Apply', actionPerformed=self.applyTemplate)
      self.templatePanel.add(self.templateButton)
     
      #pack up the frame and display it
      self.frame.pack()
      self.show()
Exemplo n.º 13
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup() 
        self.gbPanel0 = GridBagLayout() 
        self.gbcPanel0 = GridBagConstraints() 
        self.panel0.setLayout( self.gbPanel0 ) 

        self.Label_2 = JLabel("Timesketch IP Address")
        self.Label_2.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 5 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_2, self.gbcPanel0 ) 
        self.panel0.add( self.Label_2 ) 

        self.IP_Address_TF = JTextField(20, focusLost=self.setIPAddress) 
        self.IP_Address_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 5 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.IP_Address_TF, self.gbcPanel0 ) 
        self.panel0.add( self.IP_Address_TF ) 

        self.Blank_2 = JLabel( " ") 
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_2, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_2 ) 

        self.Label_3 = JLabel("Port Number")
        self.Label_3.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 9 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_3, self.gbcPanel0 ) 
        self.panel0.add( self.Label_3 ) 

        self.Port_Number_TF = JTextField(20, focusLost=self.setPortNumber) 
        self.Port_Number_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 9 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Port_Number_TF, self.gbcPanel0 ) 
        self.panel0.add( self.Port_Number_TF ) 

        self.Blank_3 = JLabel( " ") 
        self.Blank_3.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_3, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_3 ) 
        
        self.Label_4 = JLabel("User Name")
        self.Label_4.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 13 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_4, self.gbcPanel0 ) 
        self.panel0.add( self.Label_4 ) 

        self.userName_TF = JTextField(20, focusLost=self.setUserName) 
        self.userName_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 13 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.userName_TF, self.gbcPanel0 ) 
        self.panel0.add( self.userName_TF ) 

        self.Blank_4 = JLabel( " ") 
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_4, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_4 ) 

        self.Label_5 = JLabel("Password")
        self.Label_5.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 17 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_5, self.gbcPanel0 ) 
        self.panel0.add( self.Label_5 ) 

        self.password_TF = JPasswordField(20, focusLost=self.setPassword) 
#        self.password_TF = JTextField(20) 
        self.password_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 17 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.password_TF, self.gbcPanel0 ) 
        self.panel0.add( self.password_TF ) 

        self.Blank_5 = JLabel( " ") 
        self.Blank_5.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_5, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_5 ) 
        
        self.Label_6 = JLabel("Sketch Name")
        self.Label_6.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 21 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_6, self.gbcPanel0 ) 
        self.panel0.add( self.Label_6 ) 

        self.sketchName_TF = JTextField(20, focusLost=self.setsketchName) 
        self.sketchName_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 21 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.sketchName_TF, self.gbcPanel0 ) 
        self.panel0.add( self.sketchName_TF ) 

        self.Blank_6 = JLabel( " ") 
        self.Blank_6.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 23
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_6, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_6 ) 

        self.Label_7 = JLabel("Sketch Description")
        self.Label_7.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 25 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_7, self.gbcPanel0 ) 
        self.panel0.add( self.Label_7 ) 

        self.sketchDescription_TF = JTextField(20, focusLost=self.setsketchDescription) 
        self.sketchDescription_TF.setEnabled(True)
        self.gbcPanel0.gridx = 4 
        self.gbcPanel0.gridy = 25 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.sketchDescription_TF, self.gbcPanel0 ) 
        self.panel0.add( self.sketchDescription_TF ) 

        self.Blank_7 = JLabel( " ") 
        self.Blank_7.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 27
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_7, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_7 ) 
        
        # self.Check_Server_Status_BTN = JButton( "Check Server Status", actionPerformed=self.Check_Server) 
        # self.Check_Server_Status_BTN.setEnabled(True)
        # self.rbgPanel0.add( self.Save_Settings_BTN ) 
        # self.gbcPanel0.gridx = 2 
        # self.gbcPanel0.gridy = 29
        # self.gbcPanel0.gridwidth = 1 
        # self.gbcPanel0.gridheight = 1 
        # self.gbcPanel0.fill = GridBagConstraints.BOTH 
        # self.gbcPanel0.weightx = 1 
        # self.gbcPanel0.weighty = 0 
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        # self.gbPanel0.setConstraints( self.Check_Server_Status_BTN, self.gbcPanel0 ) 
        # self.panel0.add( self.Check_Server_Status_BTN ) 

        self.Error_Message = JLabel( "") 
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 31
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints( self.Error_Message, self.gbcPanel0 ) 
        self.panel0.add( self.Error_Message ) 


        self.add(self.panel0)
Exemplo n.º 14
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Error_Message = JLabel("")
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 31
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Error_Message, self.gbcPanel0)
        self.panel0.add(self.Error_Message)

        self.Label_1 = JLabel("Volatility Executable Directory")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Program_Executable_TF = JTextField(10)
        self.Program_Executable_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Program_Executable_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Program_Executable_TF)

        self.Find_Program_Exec_BTN = JButton("Find Dir",
                                             actionPerformed=self.Find_Dir)
        self.Find_Program_Exec_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Find_Program_Exec_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Program_Exec_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.Find_Program_Exec_BTN)

        self.Blank_1 = JLabel(" ")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_1, self.gbcPanel0)
        self.panel0.add(self.Blank_1)

        self.Save_Settings_BTN = JButton("Save Volatility Exec Dir",
                                         actionPerformed=self.SaveSettings)
        self.Save_Settings_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Save_Settings_BTN)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Save_Settings_BTN, self.gbcPanel0)
        self.panel0.add(self.Save_Settings_BTN)

        self.Blank_2 = JLabel(" ")
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_2, self.gbcPanel0)
        self.panel0.add(self.Blank_2)

        self.Blank_3 = JLabel(" ")
        self.Blank_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 13
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_3, self.gbcPanel0)
        self.panel0.add(self.Blank_3)

        self.Check_Box = JCheckBox(
            "Extract and Create Memory Image from Hiberfile",
            actionPerformed=self.checkBoxEvent)
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Check_Box, self.gbcPanel0)
        self.panel0.add(self.Check_Box)

        self.Blank_4 = JLabel(" ")
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 17
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_4, self.gbcPanel0)
        self.panel0.add(self.Blank_4)

        self.Blank_5 = JLabel(" ")
        self.Blank_5.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 21
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_5, self.gbcPanel0)
        self.panel0.add(self.Blank_5)

        self.Blank_6 = JLabel(" ")
        self.Blank_6.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 27
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_6, self.gbcPanel0)
        self.panel0.add(self.Blank_6)

        self.Label_3 = JLabel("Message:")
        self.Label_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 29
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_3, self.gbcPanel0)
        self.panel0.add(self.Label_3)

        self.add(self.panel0)
Exemplo n.º 15
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Label_1 = JLabel("Plaso Executable Directory")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Program_Executable_TF = JTextField(
            20, focusLost=self.setPlasoDirectory)
        self.Program_Executable_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Program_Executable_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Program_Executable_TF)

        self.Find_Program_Exec_BTN = JButton(
            "Find Dir", actionPerformed=self.Find_Plaso_Dir)
        self.Find_Program_Exec_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Find_Program_Exec_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Program_Exec_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.Find_Program_Exec_BTN)

        self.Blank_1 = JLabel(" ")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_1, self.gbcPanel0)
        self.panel0.add(self.Blank_1)

        self.Run_Plaso_CB = JCheckBox("Run Plaso Against Autopsy Image",
                                      actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Run_Plaso_CB, self.gbcPanel0)
        self.panel0.add(self.Run_Plaso_CB)

        self.dataComboBox_CB = ("All VSS", "VSS Only", "No VSS")
        self.ComboBox_CB = JComboBox(self.dataComboBox_CB)
        self.ComboBox_CB.itemStateChanged = self.onchange_cb
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.ComboBox_CB, self.gbcPanel0)
        self.panel0.add(self.ComboBox_CB)

        self.Blank_2 = JLabel(" ")
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_2, self.gbcPanel0)
        self.panel0.add(self.Blank_2)

        self.Import_Plaso_CB = JCheckBox("Import Plaso Storage File",
                                         actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 13
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Import_Plaso_CB, self.gbcPanel0)
        self.panel0.add(self.Import_Plaso_CB)

        self.Label_1 = JLabel("Plaso Storage File")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Plaso_Storage_File_TF = JTextField(
            20, focusLost=self.setPlasoStorageFile)
        self.Plaso_Storage_File_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 17
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Plaso_Storage_File_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Plaso_Storage_File_TF)

        self.Find_Storage_BTN = JButton("Find Storage File",
                                        actionPerformed=self.Find_Plaso_File)
        self.Find_Storage_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Find_Storage_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 17
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Storage_BTN, self.gbcPanel0)
        self.panel0.add(self.Find_Storage_BTN)

        self.Blank_3 = JLabel(" ")
        self.Blank_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_3, self.gbcPanel0)
        self.panel0.add(self.Blank_3)

        self.Exclude_File_Sources_CB = JCheckBox(
            "Exclude File Source", actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 21
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Exclude_File_Sources_CB,
                                     self.gbcPanel0)
        self.panel0.add(self.Exclude_File_Sources_CB)

        self.Blank_4 = JLabel(" ")
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 23
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_4, self.gbcPanel0)
        self.panel0.add(self.Blank_4)

        self.Label_3 = JLabel("Message:")
        self.Label_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 25
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_3, self.gbcPanel0)
        self.panel0.add(self.Label_3)

        self.Error_Message = JLabel("")
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 27
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Error_Message, self.gbcPanel0)
        self.panel0.add(self.Error_Message)

        self.add(self.panel0)
Exemplo n.º 16
0
    def __init__(self):
        #obtain prefixes from folder
        self.dict1 = self.obtain_prefixes(
        )  #Run prefix selection function - sets source directory, requests prefix size, outputs prefix dictionary
        lst = list(self.dict1.keys())  #pull prefixes only, as list
        self.lang = lst
        self.lst = JList(self.lang, valueChanged=self.listSelect
                         )  # pass prefix list to GUI selection list

        # general GUI layout parameters, no data processing here
        self.frame = JFrame("Image Selection")
        self.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
        self.frame.setLocation(100, 100)
        self.frame.setSize(800, 350)
        self.frame.setLayout(BorderLayout())

        self.frame.add(self.lst, BorderLayout.NORTH)
        self.lst.selectionMode = ListSelectionModel.MULTIPLE_INTERVAL_SELECTION
        self.button1 = JButton('Select item(s)',
                               actionPerformed=self.clickhere)

        #Save option radio buttons and file extension selection
        #set main right panel (sub panels will fit within this)
        rightpanel = JPanel()
        rightpanel.setLayout(BoxLayout(rightpanel, BoxLayout.Y_AXIS))

        #set up savestate panel
        buttonpanel = JPanel()
        self.radiobutton1 = JRadioButton(
            "Open selected 3D stacks and max projections \n and save max projections",
            True)
        self.radiobutton2 = JRadioButton(
            "Open selected 3D stacks and max projections \n and DO NOT save max projections"
        )
        infoLabel = JLabel(
            "<html>Hold ctrl and click multiple prefixes to select multiple options. Will load stacks and MIPs separately <br><br> Type file extension in text field below:</html>",
            SwingConstants.LEFT)
        grp = ButtonGroup()
        grp.add(self.radiobutton1)
        grp.add(self.radiobutton2)
        #buttonpanel.setLayout(BoxLayout(buttonpanel, BoxLayout.Y_AXIS))
        buttonpanel.add(Box.createVerticalGlue())
        buttonpanel.add(infoLabel)
        buttonpanel.add(Box.createRigidArea(Dimension(0, 5)))
        buttonpanel.add(self.radiobutton1)
        buttonpanel.add(Box.createRigidArea(Dimension(0, 5)))
        buttonpanel.add(self.radiobutton2)

        #file extension instruction panel
        infopanel = JPanel()
        infopanel.setLayout(FlowLayout(FlowLayout.LEFT))
        infopanel.setMaximumSize(
            infopanel.setPreferredSize(Dimension(650, 100)))
        infopanel.add(infoLabel)

        #file extension input
        inputPanel = JPanel()
        inputPanel.setLayout(BoxLayout(inputPanel, BoxLayout.X_AXIS))
        self.filetype = JTextField(".tif", 15)
        self.filetype.setMaximumSize(self.filetype.getPreferredSize())
        inputPanel.add(self.filetype)

        ########### WIP - integrate prefix selection with main pane, with dynamically updating prefix list
        ##infoLabel3 = JLabel("how long is the file prefix to group by?(integer value only)")
        ##self.prefix_init = JTextField()
        ##buttonpanel.add(infoLabel3)
        ##buttonpanel.add(self.prefix_init)
        ########### !WIP
        #add file extension and savestate panels to main panel
        rightpanel.add(infopanel)
        rightpanel.add(inputPanel)
        rightpanel.add(buttonpanel, BorderLayout.EAST)

        #split list and radiobutton pane (construct overall window)
        spl = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
        spl.leftComponent = JScrollPane(self.lst)
        spl.setDividerLocation(150)
        spl.rightComponent = rightpanel
        self.frame.add(spl)
        self.frame.add(self.button1, BorderLayout.SOUTH)

        # GUI layout done, initialise GUI to select prefixes, file extension and save option
        self.frame.setVisible(True)
Exemplo n.º 17
0
    def __init__(self, parent, title, app):
        from javax.swing import JCheckBox, JRadioButton, ButtonGroup
        self.app = app
        border = BorderFactory.createEmptyBorder(5, 7, 5, 7)
        self.getContentPane().setBorder(border)
        self.getContentPane().setLayout(BorderLayout(0, 5))
        self.tabbedPane = JTabbedPane()

        #1 Tab: general
        panel1 = JPanel()
        panel1.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))
        panel1.setLayout(BoxLayout(panel1, BoxLayout.PAGE_AXIS))

        #Checkbutton to enable/disable update check when script starts
        self.updateCBtn = JCheckBox(self.app.strings.getString("updateCBtn"))
        self.updateCBtn.setToolTipText(
            self.app.strings.getString("updateCBtn_tooltip"))

        #Download tools
        downloadBtn = JButton(self.app.strings.getString("updatesBtn"),
                              ImageProvider.get("dialogs", "refresh"),
                              actionPerformed=self.on_downloadBtn_clicked)
        downloadBtn.setToolTipText(
            self.app.strings.getString("updatesBtn_tooltip"))

        #Checkbuttons for enabling/disabling tools
        toolsPanel = JPanel(BorderLayout(0, 5))
        title = self.app.strings.getString("enable_disable_tools")
        toolsPanel.setBorder(BorderFactory.createTitledBorder(title))
        infoLbl = JLabel(self.app.strings.getString("JOSM_restart_warning"))
        infoLbl.setFont(infoLbl.getFont().deriveFont(Font.ITALIC))
        toolsPanel.add(infoLbl, BorderLayout.PAGE_START)

        toolsStatusPane = JPanel(GridLayout(len(self.app.realTools), 0))
        self.toolsCBtns = []
        for tool in self.app.realTools:
            toolCBtn = JCheckBox()
            toolCBtn.addItemListener(self)
            toolLbl = JLabel(tool.title, tool.bigIcon, JLabel.LEFT)
            self.toolsCBtns.append(toolCBtn)

            toolPane = JPanel()
            toolPane.setLayout(BoxLayout(toolPane, BoxLayout.X_AXIS))
            toolPane.add(toolCBtn)
            toolPane.add(toolLbl)
            toolsStatusPane.add(toolPane)
        toolsPanel.add(toolsStatusPane, BorderLayout.CENTER)

        #Radiobuttons for enabling/disabling layers when a new one
        #is added
        layersPanel = JPanel(GridLayout(0, 1))
        title = self.app.strings.getString("errors_layers_manager")
        layersPanel.setBorder(BorderFactory.createTitledBorder(title))
        errorLayersLbl = JLabel(
            self.app.strings.getString("errors_layers_info"))
        errorLayersLbl.setFont(errorLayersLbl.getFont().deriveFont(
            Font.ITALIC))
        layersPanel.add(errorLayersLbl)
        self.layersRBtns = {}
        group = ButtonGroup()
        for mode in self.app.layersModes:
            layerRBtn = JRadioButton(self.app.strings.getString("%s" % mode))
            group.add(layerRBtn)
            layersPanel.add(layerRBtn)
            self.layersRBtns[mode] = layerRBtn

        #Max number of errors text field
        self.maxErrorsNumberTextField = JTextField()
        self.maxErrorsNumberTextField.setToolTipText(
            self.app.strings.getString("maxErrorsNumberTextField_tooltip"))
        self.maxErrorsNumberTFieldDefaultBorder = self.maxErrorsNumberTextField.getBorder(
        )
        self.maxErrorsNumberTextField.getDocument().addDocumentListener(
            ErrNumTextListener(self))

        #layout
        self.updateCBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
        panel1.add(self.updateCBtn)
        panel1.add(Box.createRigidArea(Dimension(0, 15)))
        downloadBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
        panel1.add(downloadBtn)
        panel1.add(Box.createRigidArea(Dimension(0, 15)))
        toolsPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        panel1.add(toolsPanel)
        panel1.add(Box.createRigidArea(Dimension(0, 15)))
        layersPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        panel1.add(layersPanel)
        panel1.add(Box.createRigidArea(Dimension(0, 15)))
        maxErrP = JPanel(BorderLayout(5, 0))
        maxErrP.add(JLabel(self.app.strings.getString("max_errors_number")),
                    BorderLayout.LINE_START)
        maxErrP.add(self.maxErrorsNumberTextField, BorderLayout.CENTER)
        p = JPanel(BorderLayout())
        p.add(maxErrP, BorderLayout.PAGE_START)
        p.setAlignmentX(Component.LEFT_ALIGNMENT)
        panel1.add(p)

        self.tabbedPane.addTab(self.app.strings.getString("tab_1_title"), None,
                               panel1, None)

        #2 Tab: favourite zones
        panel2 = JPanel(BorderLayout(5, 15))
        panel2.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))

        #status
        topPanel = JPanel()
        topPanel.setLayout(BoxLayout(topPanel, BoxLayout.Y_AXIS))
        infoPanel = HtmlPanel(self.app.strings.getString("fav_zones_info"))
        infoPanel.getEditorPane().addHyperlinkListener(self)
        infoPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
        self.favZoneStatusCBtn = JCheckBox(
            self.app.strings.getString("activate_fav_area"),
            actionListener=self)
        self.favZoneStatusCBtn.setToolTipText(
            self.app.strings.getString("activate_fav_area_tooltip"))
        self.favZoneStatusCBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
        topPanel.add(infoPanel)
        topPanel.add(Box.createRigidArea(Dimension(0, 10)))
        topPanel.add(self.favZoneStatusCBtn)
        #table
        self.zonesTable = JTable()
        tableSelectionModel = self.zonesTable.getSelectionModel()
        tableSelectionModel.addListSelectionListener(ZonesTableListener(self))
        columns = [
            "",
            self.app.strings.getString("Type"),
            self.app.strings.getString("Name")
        ]
        tableModel = ZonesTableModel([], columns)
        self.zonesTable.setModel(tableModel)
        self.scrollPane = JScrollPane(self.zonesTable)
        #map
        self.zonesMap = JMapViewer()
        self.zonesMap.setZoomContolsVisible(False)
        self.zonesMap.setMinimumSize(Dimension(100, 200))

        #buttons
        self.removeBtn = JButton(self.app.strings.getString("Remove"),
                                 ImageProvider.get("dialogs", "delete"),
                                 actionPerformed=self.on_removeBtn_clicked)
        self.removeBtn.setToolTipText(
            self.app.strings.getString("remove_tooltip"))
        newBtn = JButton(self.app.strings.getString("New"),
                         ImageProvider.get("dialogs", "add"),
                         actionPerformed=self.on_newBtn_clicked)
        newBtn.setToolTipText(self.app.strings.getString("new_tooltip"))

        #layout
        panel2.add(topPanel, BorderLayout.PAGE_START)
        panel2.add(self.scrollPane, BorderLayout.LINE_START)
        panel2.add(self.zonesMap, BorderLayout.CENTER)
        self.buttonsPanel = JPanel()
        self.buttonsPanel.add(self.removeBtn)
        self.buttonsPanel.add(newBtn)
        panel2.add(self.buttonsPanel, BorderLayout.PAGE_END)

        self.tabbedPane.addTab(self.app.strings.getString("tab_2_title"), None,
                               panel2, None)

        #3 Tab Tools options
        panel3 = JPanel()
        panel3.setLayout(BoxLayout(panel3, BoxLayout.Y_AXIS))
        panel3.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))
        for tool in self.app.realTools:
            if hasattr(tool, 'prefs'):
                p = JPanel(FlowLayout(FlowLayout.LEFT))
                p.setBorder(BorderFactory.createTitledBorder(tool.title))
                p.add(tool.prefsGui)
                panel3.add(p)

        self.tabbedPane.addTab(self.app.strings.getString("tab_3_title"), None,
                               panel3, None)

        self.add(self.tabbedPane, BorderLayout.CENTER)

        exitPanel = JPanel()
        saveBtn = JButton(self.app.strings.getString("OK"),
                          ImageProvider.get("ok"),
                          actionPerformed=self.on_saveBtn_clicked)
        cancelBtn = JButton(self.app.strings.getString("cancel"),
                            ImageProvider.get("cancel"),
                            actionPerformed=self.on_cancelBtn_clicked)
        saveBtn.setToolTipText(self.app.strings.getString("save_preferences"))
        saveBtn.setAlignmentX(0.5)
        exitPanel.add(saveBtn)
        exitPanel.add(cancelBtn)
        self.add(exitPanel, BorderLayout.PAGE_END)

        self.addWindowListener(self)
        self.pack()
Exemplo n.º 18
0
    def getUiComponent(self):
        self.panel = JPanel()

        self.main = JPanel()
        self.main.setLayout(BoxLayout(self.main, BoxLayout.Y_AXIS))

        self.access_key_panel = JPanel()
        self.main.add(self.access_key_panel)
        self.access_key_panel.setLayout(
            BoxLayout(self.access_key_panel, BoxLayout.X_AXIS))
        self.access_key_panel.add(JLabel('Access Key: '))
        self.access_key = JTextField('', 25)
        self.access_key_panel.add(self.access_key)

        self.secret_key_panel = JPanel()
        self.main.add(self.secret_key_panel)
        self.secret_key_panel.setLayout(
            BoxLayout(self.secret_key_panel, BoxLayout.X_AXIS))
        self.secret_key_panel.add(JLabel('Secret Key: '))
        self.secret_key = JPasswordField('', 25)
        self.secret_key_panel.add(self.secret_key)

        self.target_host_panel = JPanel()
        self.main.add(self.target_host_panel)
        self.target_host_panel.setLayout(
            BoxLayout(self.target_host_panel, BoxLayout.X_AXIS))
        self.target_host_panel.add(JLabel('Target host: '))
        self.target_host = JTextField('example.com', 25)
        self.target_host_panel.add(self.target_host)

        self.buttons_panel = JPanel()
        self.main.add(self.buttons_panel)
        self.buttons_panel.setLayout(
            BoxLayout(self.buttons_panel, BoxLayout.X_AXIS))
        #self.save_button = JButton('Save', actionPerformed = self.saveKeys) #not implemented yet
        #self.buttons_panel.add(self.save_button)
        self.enable_button = JButton('Enable',
                                     actionPerformed=self.enableGateway)
        self.buttons_panel.add(self.enable_button)
        self.disable_button = JButton('Disable',
                                      actionPerformed=self.disableGateway)
        self.buttons_panel.add(self.disable_button)
        self.disable_button.setEnabled(False)

        self.protocol_panel = JPanel()
        self.main.add(self.protocol_panel)
        self.protocol_panel.setLayout(
            BoxLayout(self.protocol_panel, BoxLayout.Y_AXIS))
        self.protocol_panel.add(JLabel("Target Protocol:"))
        self.https_button = JRadioButton("HTTPS", True)
        self.http_button = JRadioButton("HTTP", False)
        self.protocol_panel.add(self.http_button)
        self.protocol_panel.add(self.https_button)
        buttongroup = ButtonGroup()
        buttongroup.add(self.https_button)
        buttongroup.add(self.http_button)

        self.regions_title = JPanel()
        self.main.add(self.regions_title)
        self.regions_title.add(JLabel("Regions to launch API Gateways in:"))

        self.regions_panel = JPanel()
        self.main.add(self.regions_panel)
        glayout = GridLayout(4, 3)
        self.regions_panel.setLayout(glayout)
        for region in AVAIL_REGIONS:
            cur_region = region.replace('-', '_')
            cur_region = cur_region + '_status'
            setattr(self, cur_region, JCheckBox(region, True))
            attr = getattr(self, cur_region)
            self.regions_panel.add(attr)

        self.status = JPanel()
        self.main.add(self.status)
        self.status.setLayout(BoxLayout(self.status, BoxLayout.X_AXIS))
        self.status_indicator = JLabel(DISABLED, JLabel.CENTER)
        self.status.add(self.status_indicator)

        self.panel.add(self.main)
        return self.panel
Exemplo n.º 19
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Error_Message = JLabel("")
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 31
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Error_Message, self.gbcPanel0)
        self.panel0.add(self.Error_Message)

        self.Label_1 = JLabel("Volatility Executable Directory")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Program_Executable_TF = JTextField(10)
        self.Program_Executable_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Program_Executable_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Program_Executable_TF)

        self.Find_Program_Exec_BTN = JButton("Find Dir",
                                             actionPerformed=self.Find_Dir)
        self.Find_Program_Exec_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Find_Program_Exec_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Program_Exec_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.Find_Program_Exec_BTN)

        self.Blank_1 = JLabel(" ")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_1, self.gbcPanel0)
        self.panel0.add(self.Blank_1)

        self.Save_Settings_BTN = JButton("Save Volatility Exec Dir",
                                         actionPerformed=self.SaveSettings)
        self.Save_Settings_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Save_Settings_BTN)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Save_Settings_BTN, self.gbcPanel0)
        self.panel0.add(self.Save_Settings_BTN)

        self.Blank_2 = JLabel(" ")
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_2, self.gbcPanel0)
        self.panel0.add(self.Blank_2)

        self.Version_Label_1 = JLabel("Version:")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Version_Label_1, self.gbcPanel0)
        self.panel0.add(self.Version_Label_1)

        self.Version_List = ("2.5", "2.6")
        self.Version_CB = JComboBox(self.Version_List)
        self.Version_CB.itemStateChanged = self.onchange_version
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Version_CB, self.gbcPanel0)
        self.panel0.add(self.Version_CB)

        self.Blank_3 = JLabel(" ")
        self.Blank_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 13
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_3, self.gbcPanel0)
        self.panel0.add(self.Blank_3)

        self.Plugin_Label_1 = JLabel("Plugins:")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Plugin_Label_1, self.gbcPanel0)
        self.panel0.add(self.Plugin_Label_1)

        self.Plugin_list = self.get_plugins()
        self.Plugin_LB = JList(self.Plugin_list,
                               valueChanged=self.onchange_plugins_lb)
        self.Plugin_LB.setVisibleRowCount(3)
        self.scpPlugin_LB = JScrollPane(self.Plugin_LB)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 1
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.scpPlugin_LB, self.gbcPanel0)
        self.panel0.add(self.scpPlugin_LB)

        self.Blank_4 = JLabel(" ")
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 17
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_4, self.gbcPanel0)
        self.panel0.add(self.Blank_4)

        self.Profile_Label_1 = JLabel("Profile:")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Profile_Label_1, self.gbcPanel0)
        self.panel0.add(self.Profile_Label_1)

        self.Profile_List = self.get_profiles()
        self.Profile_CB = JComboBox(self.Profile_List)
        self.Profile_CB.itemStateChanged = self.onchange_profile_cb
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 1
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Profile_CB, self.gbcPanel0)
        self.panel0.add(self.Profile_CB)

        self.Blank_5 = JLabel(" ")
        self.Blank_5.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 21
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_5, self.gbcPanel0)
        self.panel0.add(self.Blank_5)

        self.Label_2 = JLabel("Process ids to dump (comma seperated list):")
        self.Label_2.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 23
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_2, self.gbcPanel0)
        self.panel0.add(self.Label_2)

        self.Process_Ids_To_Dump_TF = JTextField(10, focusLost=self.keyPressed)
        #self.Process_Ids_To_Dump_TF.getDocument().addDocumentListener()
        self.Process_Ids_To_Dump_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 25
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Process_Ids_To_Dump_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Process_Ids_To_Dump_TF)

        self.Blank_6 = JLabel(" ")
        self.Blank_6.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 27
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_6, self.gbcPanel0)
        self.panel0.add(self.Blank_6)

        self.Label_3 = JLabel("Message:")
        self.Label_3.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 29
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_3, self.gbcPanel0)
        self.panel0.add(self.Label_3)

        self.add(self.panel0)
Exemplo n.º 20
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Error_Message = JLabel("")
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 31
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Error_Message, self.gbcPanel0)
        self.panel0.add(self.Error_Message)

        # self.Label_1 = JLabel("MacFSEvents To Include:")
        # self.Label_1.setEnabled(True)
        # self.gbcPanel0.gridx = 2
        # self.gbcPanel0.gridy = 1
        # self.gbcPanel0.gridwidth = 1
        # self.gbcPanel0.gridheight = 1
        # self.gbcPanel0.fill = GridBagConstraints.BOTH
        # self.gbcPanel0.weightx = 1
        # self.gbcPanel0.weighty = 0
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH
        # self.gbPanel0.setConstraints( self.Label_1, self.gbcPanel0 )
        # self.panel0.add( self.Label_1 )

        # self.Blank_1 = JLabel( " ")
        # self.Blank_1.setEnabled(True)
        # self.gbcPanel0.gridx = 2
        # self.gbcPanel0.gridy = 5
        # self.gbcPanel0.gridwidth = 1
        # self.gbcPanel0.gridheight = 1
        # self.gbcPanel0.fill = GridBagConstraints.BOTH
        # self.gbcPanel0.weightx = 1
        # self.gbcPanel0.weighty = 0
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH
        # self.gbPanel0.setConstraints( self.Blank_1, self.gbcPanel0 )
        # self.panel0.add( self.Blank_1 )

        # self.Plugin_list =  ('FolderEvent','Mount','Unmount','EndOfTransaction','LastHardLinkRemoved','HardLink', \
        # 'SymbolicLink','FileEvent','PermissionChange','ExtendedAttrModified','ExtendedAttrRemoved', \
        # 'DocumentRevisioning','Created','Removed','InodeMetaMod','Renamed','Modified', \
        # 'Exchange','FinderInfoMod','FolderCreated')
        # self.Plugin_LB = JList( self.Plugin_list, valueChanged=self.onchange_plugins_lb)
        # self.Plugin_LB.setVisibleRowCount( 7 )
        # self.scpPlugin_LB = JScrollPane( self.Plugin_LB )
        # self.gbcPanel0.gridx = 2
        # self.gbcPanel0.gridy = 7
        # self.gbcPanel0.gridwidth = 1
        # self.gbcPanel0.gridheight = 1
        # self.gbcPanel0.fill = GridBagConstraints.BOTH
        # self.gbcPanel0.weightx = 1
        # self.gbcPanel0.weighty = 1
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH
        # self.gbPanel0.setConstraints( self.scpPlugin_LB, self.gbcPanel0 )
        # self.panel0.add( self.scpPlugin_LB )

        self.Blank_4 = JLabel(" ")
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 17
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_4, self.gbcPanel0)
        self.panel0.add(self.Blank_4)

        # self.Label_3 = JLabel( "Message:")
        # self.Label_3.setEnabled(True)
        # self.gbcPanel0.gridx = 2
        # self.gbcPanel0.gridy = 29
        # self.gbcPanel0.gridwidth = 1
        # self.gbcPanel0.gridheight = 1
        # self.gbcPanel0.fill = GridBagConstraints.BOTH
        # self.gbcPanel0.weightx = 1
        # self.gbcPanel0.weighty = 0
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH
        # self.gbPanel0.setConstraints( self.Label_3, self.gbcPanel0 )
        # self.panel0.add( self.Label_3 )

        self.add(self.panel0)
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Exec_Program_CB = JCheckBox("Execute Program",
                                         actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Exec_Program_CB, self.gbcPanel0)
        self.panel0.add(self.Exec_Program_CB)

        self.Program_Executable_TF = JTextField(20)
        self.Program_Executable_TF.setEnabled(False)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Program_Executable_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Program_Executable_TF)

        self.Find_Program_Exec_BTN = JButton("Find Exec",
                                             actionPerformed=self.onClick)
        self.Find_Program_Exec_BTN.setEnabled(False)
        self.rbgPanel0.add(self.Find_Program_Exec_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Program_Exec_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.Find_Program_Exec_BTN)

        self.Blank_1 = JLabel(" ")
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_1, self.gbcPanel0)
        self.panel0.add(self.Blank_1)

        self.Save_Settings_BTN = JButton("Save Settings",
                                         actionPerformed=self.SaveSettings)
        self.Save_Settings_BTN.setEnabled(True)
        self.rbgPanel0.add(self.Save_Settings_BTN)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Save_Settings_BTN, self.gbcPanel0)
        self.panel0.add(self.Save_Settings_BTN)

        self.Blank_2 = JLabel(" ")
        self.Blank_2.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_2, self.gbcPanel0)
        self.panel0.add(self.Blank_2)

        self.Label_1 = JLabel("Error Message:")
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Error_Message = JLabel("")
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Error_Message, self.gbcPanel0)
        self.panel0.add(self.Error_Message)

        self.add(self.panel0)
Exemplo n.º 22
0
    def initComponents(self):
        self.apps_checkboxes_list = []

        self.setLayout(BoxLayout(self, BoxLayout.PAGE_AXIS))
        self.setPreferredSize(Dimension(300, 0))

        # title
        self.p_title = SettingsUtils.createPanel()

        self.lb_title = JLabel("Forensic Analysis for Mobile Apps")
        self.lb_title.setFont(self.lb_title.getFont().deriveFont(
            Font.BOLD, 15))
        self.p_title.add(self.lb_title)
        self.add(self.p_title)

        # end of title

        # info menu
        self.p_info = SettingsUtils.createPanel()
        self.p_info.setPreferredSize(Dimension(300, 20))

        self.lb_info = SettingsUtils.createInfoLabel("")
        self.lb_info2 = SettingsUtils.createInfoLabel("")
        self.sp2 = SettingsUtils.createSeparators(1)

        self.p_method = SettingsUtils.createPanel()
        self.bg_method = ButtonGroup()

        autopsy_version = PsyUtils.get_autopsy_version()

        if ((autopsy_version["major"] == 4 and autopsy_version["minor"] <= 17)
                or autopsy_version["major"] < 4):
            self.p_info.add(self.lb_info)
            self.p_info.add(self.lb_info2, BorderLayout.SOUTH)

            self.rb_selectedDatasource = SettingsUtils.createRadioButton(
                "Analyze selected datasource", "method_datasource",
                self.onMethodChange)
            self.bg_method.add(self.rb_selectedDatasource)

            # self.rb_importReportFile = SettingsUtils.createRadioButton("Import previous generated report file","method_importfile" ,self.onMethodChange)
            self.rb_liveExtraction = SettingsUtils.createRadioButton(
                "Live extraction with ADB", "method_adb", self.onMethodChange)
            self.rb_selectedDatasource.setSelected(True)

            #self.bg_method.add(self.rb_importReportFile)
            self.bg_method.add(self.rb_liveExtraction)

            self.p_method.add(JLabel("Analysis method"))
            self.p_method.add(self.rb_selectedDatasource)
            self.p_method.add(self.rb_liveExtraction)

        else:
            self.p_info.add(
                SettingsUtils.createInfoLabel(
                    "It will analyze the data source with previously selected method and index the forensic artifacts."
                ))

        self.add(self.p_method)

        self.p_apps = SettingsUtils.createPanel(True)

        sorted_items = OrderedDict(sorted(Utils.get_all_packages().items()))

        for app, app_id in sorted_items.iteritems():
            #(app, app_id)
            checkbox = SettingsUtils.addApplicationCheckbox(
                app, app_id, self.getSelectedApps)
            self.add(checkbox)
            self.apps_checkboxes_list.append(checkbox)
            self.p_apps.add(checkbox)

        self.add(self.p_apps)
        self.add(self.p_info)
Exemplo n.º 23
0
    def registerExtenderCallbacks(self, callbacks):
        # keep a reference to our callbacks object
        self._callbacks = callbacks

        # obtain an extension helpers object
        self._helpers = callbacks.getHelpers()

        # set our extension name
        callbacks.setExtensionName("Burp Scope Monitor Experimental")

        self.GLOBAL_HANDLER_ANALYZED = False
        self.GLOBAL_HANDLER = False
        self.STATUS = False
        self.AUTOSAVE_REQUESTS = 10
        self.AUTOSAVE_TIMEOUT = 600  # 10 minutes should be fine
        self.CONFIG_INSCOPE = True

        self.BAD_EXTENSIONS_DEFAULT = [
            '.gif', '.png', '.js', '.woff', '.woff2', '.jpeg', '.jpg', '.css',
            '.ico', '.m3u8', '.ts', '.svg'
        ]
        self.BAD_MIMES_DEFAULT = [
            'gif', 'script', 'jpeg', 'jpg', 'png', 'video', 'mp2t'
        ]

        self.BAD_EXTENSIONS = self.BAD_EXTENSIONS_DEFAULT
        self.BAD_MIMES = self.BAD_MIMES_DEFAULT

        # create the log and a lock on which to synchronize when adding log entries

        self._currentlyDisplayedItem = None

        self.SELECTED_MODEL_ROW = 0
        self.SELECTED_VIEW_ROW = 0

        self._log = ArrayList()
        self._fullLog = ArrayList()
        self._lock = Lock()
        self._lockFile = Lock()

        # main split pane
        self._parentPane = JTabbedPane()

        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)

        ##### config pane
        self._config = JTabbedPane()

        config = JPanel()
        iexport = JPanel()

        #config.setLayout(BorderLayout())
        config.setLayout(None)
        iexport.setLayout(None)

        # config radio button
        X_BASE = 40
        Y_OFFSET = 5
        Y_OPTION = 200
        Y_OPTION_SPACING = 20
        Y_CHECKMARK_SPACING = 20

        self.showAllButton = JRadioButton(SHOW_ALL_BUTTON_LABEL, True)
        self.showNewButton = JRadioButton(SHOW_NEW_BUTTON_LABEL, False)
        self.showTestedButton = JRadioButton(SHOW_TEST_BUTTON_LABEL, False)

        self.showAllButton.setBounds(40, 60 + Y_OFFSET, 400, 30)
        self.showNewButton.setBounds(40, 80 + Y_OFFSET, 400, 30)
        self.showTestedButton.setBounds(40, 100 + Y_OFFSET, 400, 30)
        #self.showNewButton = JRadioButton(SHOW_NEW_BUTTON_LABEL, False)
        #self.showTestedButton = JRadioButton(SHOW_TEST_BUTTON_LABEL, False)

        self.showAllButton.addActionListener(self.handleRadioConfig)
        self.showNewButton.addActionListener(self.handleRadioConfig)
        self.showTestedButton.addActionListener(self.handleRadioConfig)

        self.clearButton = JButton("Clear")
        self.clearButton.addActionListener(self.handleClearButton)
        self.clearButton.setBounds(40, 20, 100, 30)

        self.startButton = JButton(MONITOR_ON_LABEL)
        self.startButton.addActionListener(self.handleStartButton)
        self.startButton.setBounds(150, 20, 200, 30)

        self.badExtensionsLabel = JLabel("Ignore extensions:")
        self.badExtensionsLabel.setBounds(X_BASE, 150, 200, 30)

        self.badExtensionsText = JTextArea("")
        self.loadBadExtensions()
        self.badExtensionsText.setBounds(X_BASE, 175, 310, 30)

        self.badExtensionsButton = JButton("Save")
        self.badExtensionsButton.addActionListener(
            self.handleBadExtensionsButton)
        self.badExtensionsButton.setBounds(355, 175, 70, 30)

        self.badExtensionsDefaultButton = JButton("Load Defaults")
        self.badExtensionsDefaultButton.addActionListener(
            self.handleBadExtensionsDefaultButton)
        self.badExtensionsDefaultButton.setBounds(430, 175, 120, 30)

        self.badMimesLabel = JLabel("Ignore mime types:")
        self.badMimesLabel.setBounds(X_BASE, 220, 200, 30)

        self.badMimesText = JTextArea("")
        self.loadBadMimes()
        self.badMimesText.setBounds(X_BASE, 245, 310, 30)

        self.badMimesButton = JButton("Save")
        self.badMimesButton.addActionListener(self.handleBadMimesButton)
        self.badMimesButton.setBounds(355, 245, 70, 30)

        self.badMimesDefaultButton = JButton("Load Defaults")
        self.badMimesDefaultButton.addActionListener(
            self.handleBadMimesDefaultButton)
        self.badMimesDefaultButton.setBounds(430, 245, 120, 30)

        self.otherLabel = JLabel("Other:")
        self.otherLabel.setBounds(40, 300, 120, 30)

        self.otherLabel2 = JLabel("Other:")
        self.otherLabel2.setBounds(X_BASE, Y_OPTION, 120, 30)

        self.autoSaveOption = JCheckBox("Auto save periodically")
        self.autoSaveOption.setSelected(True)
        self.autoSaveOption.addActionListener(self.handleAutoSaveOption)
        self.autoSaveOption.setBounds(X_BASE, Y_OPTION + Y_CHECKMARK_SPACING,
                                      420, 30)

        self.repeaterOptionButton = JCheckBox(
            "Repeater request automatically marks as analyzed")
        self.repeaterOptionButton.setSelected(True)
        self.repeaterOptionButton.addActionListener(
            self.handleRepeaterOptionButton)
        self.repeaterOptionButton.setBounds(50, 330, 420, 30)

        self.scopeOptionButton = JCheckBox("Follow Burp Target In Scope rules")
        self.scopeOptionButton.setSelected(True)
        self.scopeOptionButton.addActionListener(self.handleScopeOptionButton)
        self.scopeOptionButton.setBounds(50, 350, 420, 30)

        self.startOptionButton = JCheckBox("Autostart Scope Monitor")
        self.startOptionButton.setSelected(True)
        self.startOptionButton.addActionListener(self.handleStartOption)
        self.startOptionButton.setBounds(50, 350 + Y_OPTION_SPACING, 420, 30)

        self.markTestedRequestsProxy = JCheckBox(
            "Color request in Proxy tab if analyzed")
        self.markTestedRequestsProxy.setSelected(True)
        self.markTestedRequestsProxy.addActionListener(
            self.handleTestedRequestsProxy)
        self.markTestedRequestsProxy.setBounds(50, 350 + Y_OPTION_SPACING * 2,
                                               420, 30)

        self.markNotTestedRequestsProxy = JCheckBox(
            "Color request in Proxy tab if NOT analyzed")
        self.markNotTestedRequestsProxy.setSelected(True)
        self.markNotTestedRequestsProxy.addActionListener(
            self.handleNotTestedRequestsProxy)
        self.markNotTestedRequestsProxy.setBounds(50,
                                                  350 + Y_OPTION_SPACING * 3,
                                                  420, 30)

        self.saveButton = JButton("Save now")
        self.saveButton.addActionListener(self.handleSaveButton)
        self.saveButton.setBounds(X_BASE + 320, 95, 90, 30)

        self.loadButton = JButton("Load now")
        self.loadButton.addActionListener(self.handleLoadButton)
        self.loadButton.setBounds(X_BASE + 420, 95, 90, 30)

        self.selectPath = JButton("Select path")
        self.selectPath.addActionListener(self.selectExportFile)
        self.selectPath.setBounds(X_BASE + 530, 60, 120, 30)

        self.selectPathText = JTextArea("")
        self.selectPathText.setBounds(X_BASE, 60, 510, 30)

        self.selectPathLabel = JLabel("State file:")
        self.selectPathLabel.setBounds(X_BASE, 30, 200, 30)

        bGroup = ButtonGroup()

        bGroup.add(self.showAllButton)
        bGroup.add(self.showNewButton)
        bGroup.add(self.showTestedButton)

        config.add(self.clearButton)
        config.add(self.startButton)
        config.add(self.startOptionButton)
        config.add(self.showAllButton)
        config.add(self.showNewButton)
        config.add(self.showTestedButton)

        config.add(self.badExtensionsButton)
        config.add(self.badExtensionsText)
        config.add(self.badExtensionsLabel)

        config.add(self.badMimesButton)
        config.add(self.badMimesText)
        config.add(self.badMimesLabel)

        config.add(self.badExtensionsDefaultButton)
        config.add(self.badMimesDefaultButton)

        config.add(self.otherLabel)
        config.add(self.repeaterOptionButton)
        config.add(self.scopeOptionButton)
        config.add(self.markTestedRequestsProxy)
        config.add(self.markNotTestedRequestsProxy)

        iexport.add(self.saveButton)
        iexport.add(self.loadButton)
        iexport.add(self.selectPath)
        iexport.add(self.selectPathText)
        iexport.add(self.selectPathLabel)
        iexport.add(self.otherLabel2)
        iexport.add(self.autoSaveOption)

        self._config.addTab("General", config)
        self._config.addTab("Import/Export", iexport)

        ##### end config pane

        self._parentPane.addTab("Monitor", self._splitpane)
        self._parentPane.addTab("Config", self._config)

        # table of log entries
        self.logTable = Table(self)

        #self.logTable.setDefaultRenderer(self.logTable.getColumnClass(0), ColoredTableCellRenderer(self))

        self.logTable.setAutoCreateRowSorter(True)
        self.logTable.setRowSelectionAllowed(True)

        renderer = ColoredTableCellRenderer(self)
        #column = TableColumn(0, 190, renderer, None)

        print 'Initiating... '

        # this could be improved by fetching initial dimensions
        self.logTable.getColumn("URL").setPreferredWidth(720)  # noscope
        self.logTable.getColumn("URL").setResizable(True)

        self.logTable.getColumn("Checked").setCellRenderer(renderer)
        self.logTable.getColumn("Checked").setPreferredWidth(80)
        self.logTable.getColumn("Checked").setMaxWidth(80)

        self.logTable.getColumn("Method").setPreferredWidth(120)
        #self.logTable.getColumn("Method").setMaxWidth(120)
        self.logTable.getColumn("Method").setResizable(True)

        self.logTable.getColumn("Time").setPreferredWidth(120)  # noscope
        self.logTable.getColumn("Time").setResizable(True)

        scrollPane = JScrollPane(self.logTable)
        self._splitpane.setLeftComponent(scrollPane)

        # tabs with request/response viewers
        tabs = JTabbedPane()
        self._requestViewer = callbacks.createMessageEditor(self, False)
        self._responseViewer = callbacks.createMessageEditor(self, False)
        tabs.addTab("Request", self._requestViewer.getComponent())
        tabs.addTab("Response", self._responseViewer.getComponent())
        self._splitpane.setRightComponent(tabs)

        ## Row sorter shit

        #self._tableRowSorterAutoProxyAutoAction = CustomTableRowSorter(self.logTable.getModel())
        #self.logTable.setRowSorter(self._tableRowSorterAutoProxyAutoAction)

        markAnalyzedButton = JMenuItem("Mark Requests as Analyzed")
        markAnalyzedButton.addActionListener(markRequestsHandler(self, True))

        markNotAnalyzedButton = JMenuItem("Mark Requests as NOT Analyzed")
        markNotAnalyzedButton.addActionListener(
            markRequestsHandler(self, False))

        sendRequestMenu = JMenuItem("Send Request to Repeater")
        sendRequestMenu.addActionListener(sendRequestRepeater(self))

        deleteRequestMenu = JMenuItem("Delete request")
        deleteRequestMenu.addActionListener(deleteRequestHandler(self))

        self.menu = JPopupMenu("Popup")
        self.menu.add(markAnalyzedButton)
        self.menu.add(markNotAnalyzedButton)
        self.menu.add(sendRequestMenu)
        self.menu.add(deleteRequestMenu)

        # customize our UI components
        callbacks.customizeUiComponent(self._parentPane)
        callbacks.customizeUiComponent(self._splitpane)
        callbacks.customizeUiComponent(self._config)
        callbacks.customizeUiComponent(config)
        callbacks.customizeUiComponent(self.logTable)
        callbacks.customizeUiComponent(scrollPane)
        callbacks.customizeUiComponent(tabs)

        callbacks.registerContextMenuFactory(self)
        callbacks.registerExtensionStateListener(self)
        callbacks.registerScannerCheck(passiveScanner(self))

        # add the custom tab to Burp's UI
        callbacks.addSuiteTab(self)

        # register ourselves as an HTTP listener
        callbacks.registerHttpListener(self)

        self.loadConfigs()

        print "Loaded!"

        print "Experimental import state.. "
        self.importState("")

        self.SC = sched.scheduler(time.time, time.sleep)
        self.SCC = self.SC.enter(10, 1, self.autoSave, (self.SC, ))
        self.SC.run()

        return
Exemplo n.º 24
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Exec_Program_CB = JCheckBox("Execute Program",
                                         actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Exec_Program_CB, self.gbcPanel0)
        self.panel0.add(self.Exec_Program_CB)

        self.Program_Executable_TF = JTextField(20)
        self.Program_Executable_TF.setEnabled(False)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Program_Executable_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Program_Executable_TF)

        self.Find_Program_Exec_BTN = JButton("Find Exec",
                                             actionPerformed=self.onClick)
        self.Find_Program_Exec_BTN.setEnabled(False)
        self.rbgPanel0.add(self.Find_Program_Exec_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Program_Exec_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.Find_Program_Exec_BTN)

        self.Imp_File_CB = JCheckBox("Import File",
                                     actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Imp_File_CB, self.gbcPanel0)
        self.panel0.add(self.Imp_File_CB)

        self.File_Imp_TF = JTextField(20)
        self.File_Imp_TF.setEnabled(False)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.File_Imp_TF, self.gbcPanel0)
        self.panel0.add(self.File_Imp_TF)

        self.Find_Imp_File_BTN = JButton("Find File",
                                         actionPerformed=self.onClick)
        self.Find_Imp_File_BTN.setEnabled(False)
        self.rbgPanel0.add(self.Find_Imp_File_BTN)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Find_Imp_File_BTN, self.gbcPanel0)
        self.panel0.add(self.Find_Imp_File_BTN)

        self.Check_Box_CB = JCheckBox("Check Box 1",
                                      actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Check_Box_CB, self.gbcPanel0)
        self.panel0.add(self.Check_Box_CB)

        self.dataComboBox_CB = ("Chocolate", "Ice Cream", "Apple Pie")
        self.ComboBox_CB = JComboBox(self.dataComboBox_CB)
        self.ComboBox_CB.itemStateChanged = self.onchange_cb
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.ComboBox_CB, self.gbcPanel0)
        self.panel0.add(self.ComboBox_CB)

        self.dataList_Box_LB = ("Chocolate", "Ice Cream", "Apple Pie",
                                "Pudding", "Candy")
        self.List_Box_LB = JList(self.dataList_Box_LB,
                                 valueChanged=self.onchange_lb)
        #self.List_Box_LB.itemStateChanged = self.onchange_lb
        self.List_Box_LB.setVisibleRowCount(3)
        self.scpList_Box_LB = JScrollPane(self.List_Box_LB)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 1
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.scpList_Box_LB, self.gbcPanel0)
        self.panel0.add(self.scpList_Box_LB)

        # self.Radio_Button_RB = JRadioButton( "Radio Button"  )
        # self.rbgPanel0.add( self.Radio_Button_RB )
        # self.gbcPanel0.gridx = 7
        # self.gbcPanel0.gridy = 17
        # self.gbcPanel0.gridwidth = 1
        # self.gbcPanel0.gridheight = 1
        # self.gbcPanel0.fill = GridBagConstraints.BOTH
        # self.gbcPanel0.weightx = 1
        # self.gbcPanel0.weighty = 0
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH
        # self.gbPanel0.setConstraints( self.Radio_Button_RB, self.gbcPanel0 )
        # self.panel0.add( self.Radio_Button_RB )

        # self.Label_1 = JLabel( "Error Message:")
        # self.Label_1.setEnabled(True)
        # self.gbcPanel0.gridx = 2
        # self.gbcPanel0.gridy = 19
        # self.gbcPanel0.gridwidth = 1
        # self.gbcPanel0.gridheight = 1
        # self.gbcPanel0.fill = GridBagConstraints.BOTH
        # self.gbcPanel0.weightx = 1
        # self.gbcPanel0.weighty = 0
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH
        # self.gbPanel0.setConstraints( self.Label_1, self.gbcPanel0 )
        # self.panel0.add( self.Label_1 )

        # self.Error_Message = JLabel( "")
        # self.Error_Message.setEnabled(True)
        # self.gbcPanel0.gridx = 6
        # self.gbcPanel0.gridy = 19
        # self.gbcPanel0.gridwidth = 1
        # self.gbcPanel0.gridheight = 1
        # self.gbcPanel0.fill = GridBagConstraints.BOTH
        # self.gbcPanel0.weightx = 1
        # self.gbcPanel0.weighty = 0
        # self.gbcPanel0.anchor = GridBagConstraints.NORTH
        # self.gbPanel0.setConstraints( self.Error_Message, self.gbcPanel0 )
        # self.panel0.add( self.Error_Message )

        self.add(self.panel0)
def loginPage():
    global heading
    global rbAdmin
    global rbTeacher
    global rbStudent
    global frame
    global tfLoginId
    global tfPassword

    frame = JFrame("Login Form ")
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
    frame.setSize(500, 500)
    frame.setLocation(200, 200)
    frame.setLayout(None)
    frame.setVisible(True)

    panel = JPanel()
    panel.setSize(500, 500)
    panel.setLocation(0, 0)
    panel.setLayout(None)

    panel.setBackground(Color.BLUE)

    heading = JLabel("Admin Login")
    heading.setBounds(200, 50, 150, 30)

    rbAdmin = JRadioButton("Admin", actionPerformed=clickRadio)
    rbTeacher = JRadioButton("Teacher", actionPerformed=clickRadio)
    rbStudent = JRadioButton("Student", actionPerformed=clickRadio)

    rbAdmin.setBounds(100, 150, 100, 20)
    rbTeacher.setBounds(200, 150, 100, 20)
    rbStudent.setBounds(300, 150, 100, 20)

    btnGroup = ButtonGroup()
    btnGroup.add(rbAdmin)
    btnGroup.add(rbTeacher)
    btnGroup.add(rbStudent)

    lbLoginId = JLabel("LoginId")
    lbPassword = JLabel("Password")

    lbLoginId.setBounds(100, 230, 150, 30)
    lbPassword.setBounds(100, 300, 150, 30)

    tfLoginId = JTextField()
    tfPassword = JTextField()

    tfLoginId.setBounds(250, 230, 150, 30)
    tfPassword.setBounds(250, 300, 150, 30)

    btnLogin = JButton("Login", actionPerformed=clickLogin)
    btnLogin.setBounds(350, 350, 100, 30)

    btnReg = JButton("New Institute Registration", actionPerformed=clickReg)
    btnReg.setBounds(350, 400, 100, 30)

    panel.add(heading)
    panel.add(rbAdmin)
    panel.add(rbTeacher)
    panel.add(rbStudent)
    panel.add(lbLoginId)
    panel.add(lbPassword)
    panel.add(tfLoginId)
    panel.add(tfPassword)
    panel.add(btnLogin)
    panel.add(btnReg)

    panel.setVisible(True)

    frame.add(panel)
Exemplo n.º 26
0
    def getConfigurationPanel(self):
        self.artifact_list = []
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.Label_0 = JLabel("Number of Object to Display per page")
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_0, self.gbcPanel0)
        self.panel0.add(self.Label_0)

        self.Num_Of_Objs_Per_Page_TF = JTextField(5)
        self.Num_Of_Objs_Per_Page_TF.setEnabled(True)
        self.Num_Of_Objs_Per_Page_TF.setText("10")
        self.gbcPanel0.gridx = 3
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Num_Of_Objs_Per_Page_TF,
                                     self.gbcPanel0)
        self.panel0.add(self.Num_Of_Objs_Per_Page_TF)

        self.Blank_0 = JLabel(" ")
        self.Blank_0.setEnabled(True)
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_0, self.gbcPanel0)
        self.panel0.add(self.Blank_0)

        self.Label_1 = JLabel("Title To Appear on Case Info")
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_1, self.gbcPanel0)
        self.panel0.add(self.Label_1)

        self.Title_Case_TF = JTextField(30)
        self.Title_Case_TF.setEnabled(True)
        self.Title_Case_TF.setText("Report of media analysis")
        self.gbcPanel0.gridx = 3
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Title_Case_TF, self.gbcPanel0)
        self.panel0.add(self.Title_Case_TF)

        self.Label_2 = JLabel("Report Number To Appear on Case Info")
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_2, self.gbcPanel0)
        self.panel0.add(self.Label_2)

        self.Report_Number_TF = JTextField(30)
        self.Report_Number_TF.setEnabled(True)
        self.Report_Number_TF.setText(Case.getCurrentCase().getNumber())
        self.gbcPanel0.gridx = 3
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Report_Number_TF, self.gbcPanel0)
        self.panel0.add(self.Report_Number_TF)

        self.Label_3 = JLabel("Examiner(s) To Appear on Case Info")
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_3, self.gbcPanel0)
        self.panel0.add(self.Label_3)

        self.Examiners_TF = JTextField(30)
        self.Examiners_TF.setEnabled(True)
        self.Examiners_TF.setText(Case.getCurrentCase().getExaminer())
        self.gbcPanel0.gridx = 3
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Examiners_TF, self.gbcPanel0)
        self.panel0.add(self.Examiners_TF)

        self.Label_4 = JLabel("Description To Appear on Case Info")
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_4, self.gbcPanel0)
        self.panel0.add(self.Label_4)

        self.Description_TF = JTextField(30)
        self.Description_TF.setEnabled(True)
        #self.Description_TF.setText(Case.getCurrentCase().getNumber())
        self.gbcPanel0.gridx = 3
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Description_TF, self.gbcPanel0)
        self.panel0.add(self.Description_TF)

        self.Blank_4 = JLabel(" ")
        self.Blank_4.setEnabled(True)
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_4, self.gbcPanel0)
        self.panel0.add(self.Blank_4)

        self.Label_5 = JLabel("Tags to Select for Report:")
        self.Label_5.setEnabled(True)
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 21
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Label_5, self.gbcPanel0)
        self.panel0.add(self.Label_5)

        self.List_Box_LB = JList(self.find_tags(),
                                 valueChanged=self.onchange_lb)
        self.List_Box_LB.setVisibleRowCount(3)
        self.scpList_Box_LB = JScrollPane(self.List_Box_LB)
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 23
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 1
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.scpList_Box_LB, self.gbcPanel0)
        self.panel0.add(self.scpList_Box_LB)

        self.Blank_5 = JLabel(" ")
        self.Blank_5.setEnabled(True)
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 25
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.Blank_5, self.gbcPanel0)
        self.panel0.add(self.Blank_5)

        #self.add(self.panel0)
        return self.panel0
Exemplo n.º 27
0
    def initComponents(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup() 
        self.gbPanel0 = GridBagLayout() 
        self.gbcPanel0 = GridBagConstraints() 
        self.panel0.setLayout( self.gbPanel0 ) 

        self.LabelA = JLabel("VirusTotal API Key:")
        self.LabelA.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 1 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.LabelA, self.gbcPanel0 ) 
        self.panel0.add( self.LabelA ) 

        self.API_Key_TF = JTextField(20) 
        self.API_Key_TF.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 3 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.API_Key_TF, self.gbcPanel0 ) 
        self.panel0.add( self.API_Key_TF ) 

        self.Blank_1 = JLabel( " ") 
        self.Blank_1.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 6
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Blank_1, self.gbcPanel0 ) 
        self.panel0.add( self.Blank_1 ) 

        self.Private_API_Key_CB = JCheckBox("Private API Key?", actionPerformed=self.checkBoxEvent)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 5 
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Private_API_Key_CB, self.gbcPanel0 ) 
        self.panel0.add( self.Private_API_Key_CB )

        self.Save_Settings_BTN = JButton( "Save Settings", actionPerformed=self.SaveSettings) 
        self.Save_Settings_BTN.setEnabled(True)
        self.rbgPanel0.add( self.Save_Settings_BTN ) 
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 8
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Save_Settings_BTN, self.gbcPanel0 ) 
        self.panel0.add( self.Save_Settings_BTN ) 

        self.Label_1 = JLabel( "Error Message:") 
        self.Label_1.setEnabled(True)
        self.gbcPanel0.gridx = 2 
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH 
        self.gbPanel0.setConstraints( self.Label_1, self.gbcPanel0 ) 
        self.panel0.add( self.Label_1 ) 

        self.Error_Message = JLabel( "") 
        self.Error_Message.setEnabled(True)
        self.gbcPanel0.gridx = 6
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1 
        self.gbcPanel0.gridheight = 1 
        self.gbcPanel0.fill = GridBagConstraints.BOTH 
        self.gbcPanel0.weightx = 1 
        self.gbcPanel0.weighty = 0 
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints( self.Error_Message, self.gbcPanel0 ) 
        self.panel0.add( self.Error_Message ) 

        self.add(self.panel0)
    def init_components(self):
        self.panel0 = JPanel()

        self.rbgPanel0 = ButtonGroup()
        self.gbPanel0 = GridBagLayout()
        self.gbcPanel0 = GridBagConstraints()
        self.panel0.setLayout(self.gbPanel0)

        self.host_L = JLabel("Host:")
        self.host_L.setEnabled(True)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.host_L, self.gbcPanel0)
        self.panel0.add(self.host_L)

        self.port_L = JLabel("Port:")
        self.port_L.setEnabled(True)
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 1
        self.gbcPanel0.gridwidth = 2
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.port_L, self.gbcPanel0)
        self.panel0.add(self.port_L)

        self.host_TF = JTextField(10)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 2
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.host_TF, self.gbcPanel0)
        self.panel0.add(self.host_TF)

        format = NumberFormat.getInstance()
        format.setGroupingUsed(False)

        port_formatter = NumberFormatter(format)
        port_formatter.setValueClass(Integer)
        port_formatter.setAllowsInvalid(False)
        port_formatter.setMinimum(Integer(0))
        port_formatter.setMaximum(Integer(65535))

        self.port_TF = JFormattedTextField(port_formatter)
        self.gbcPanel0.gridx = 1
        self.gbcPanel0.gridy = 2
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.port_TF, self.gbcPanel0)
        self.panel0.add(self.port_TF)

        self.blank_1_L = JLabel(" ")
        self.blank_1_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 3
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_1_L, self.gbcPanel0)
        self.panel0.add(self.blank_1_L)

        self.image_formats_L = JLabel("Format of images (separator \";\"):")
        self.port_L.setEnabled(True)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 4
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.image_formats_L, self.gbcPanel0)
        self.panel0.add(self.image_formats_L)

        self.image_formats_TF = JTextField(10)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 5
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.image_formats_TF, self.gbcPanel0)
        self.panel0.add(self.image_formats_TF)

        self.blank_2_L = JLabel(" ")
        self.blank_2_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 6
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_2_L, self.gbcPanel0)
        self.panel0.add(self.blank_2_L)

        self.min_probability_L = JLabel("Confidence minimum (%):")
        self.port_L.setEnabled(True)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 7
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.min_probability_L, self.gbcPanel0)
        self.panel0.add(self.min_probability_L)

        min_probabilty_formatter = NumberFormatter(format)
        min_probabilty_formatter.setValueClass(Integer)
        min_probabilty_formatter.setAllowsInvalid(False)
        min_probabilty_formatter.setMinimum(Integer(0))
        min_probabilty_formatter.setMaximum(Integer(100))

        self.min_probability_TF = JFormattedTextField(min_probabilty_formatter)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 8
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.min_probability_TF, self.gbcPanel0)
        self.panel0.add(self.min_probability_TF)

        self.blank_3_L = JLabel(" ")
        self.blank_3_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 9
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_3_L, self.gbcPanel0)
        self.panel0.add(self.blank_3_L)

        self.min_file_size_L = JLabel("Minimum file size (KB):")
        self.min_file_size_L.setEnabled(True)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 10
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.min_file_size_L, self.gbcPanel0)
        self.panel0.add(self.min_file_size_L)

        min_file_size_formatter = NumberFormatter(format)
        min_file_size_formatter.setValueClass(Integer)
        min_file_size_formatter.setAllowsInvalid(False)
        min_file_size_formatter.setMinimum(Integer(0))

        self.min_file_size_TF = JFormattedTextField(min_file_size_formatter)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 11
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.min_file_size_TF, self.gbcPanel0)
        self.panel0.add(self.min_file_size_TF)

        self.blank_4_L = JLabel(" ")
        self.blank_4_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 12
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_4_L, self.gbcPanel0)
        self.panel0.add(self.blank_4_L)

        self.detectable_obejcts_BTN = \
            JButton("List of Objects to Detect", actionPerformed=self.show_detectable_objects_dialog)
        # self.save_Settings_BTN.setPreferredSize(Dimension(1, 20))
        self.rbgPanel0.add(self.detectable_obejcts_BTN)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 13
        self.gbPanel0.setConstraints(self.detectable_obejcts_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.detectable_obejcts_BTN)

        self.blank_5_L = JLabel(" ")
        self.blank_5_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 14
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_5_L, self.gbcPanel0)
        self.panel0.add(self.blank_5_L)

        self.error_message = JLabel("", JLabel.CENTER)
        self.error_message.setForeground(Color.red)
        self.error_message.setEnabled(True)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 15
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.error_message, self.gbcPanel0)
        self.panel0.add(self.error_message)

        self.message = JLabel("", JLabel.CENTER)
        self.message.setEnabled(True)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 16
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.message, self.gbcPanel0)
        self.panel0.add(self.message)

        self.save_settings_BTN = JButton("Save Settings",
                                         actionPerformed=self.save_settings)
        # self.save_Settings_BTN.setPreferredSize(Dimension(1, 20))
        self.rbgPanel0.add(self.save_settings_BTN)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 17
        self.gbPanel0.setConstraints(self.save_settings_BTN, self.gbcPanel0)
        self.panel0.add(self.save_settings_BTN)

        self.blank_6_L = JLabel(" ")
        self.blank_6_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 18
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_6_L, self.gbcPanel0)
        self.panel0.add(self.blank_6_L)

        self.blank_7_L = JLabel(" ")
        self.blank_7_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 19
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_7_L, self.gbcPanel0)
        self.panel0.add(self.blank_7_L)

        self.check_server_connection_BTN = \
            JButton("Check server connection", actionPerformed=self.check_server_connection)
        # self.save_Settings_BTN.setPreferredSize(Dimension(1, 20))
        self.rbgPanel0.add(self.check_server_connection_BTN)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 20
        self.gbPanel0.setConstraints(self.check_server_connection_BTN,
                                     self.gbcPanel0)
        self.panel0.add(self.check_server_connection_BTN)

        self.blank_8_L = JLabel(" ")
        self.blank_8_L.setEnabled(True)
        self.gbcPanel0.gridx = 2
        self.gbcPanel0.gridy = 21
        self.gbcPanel0.gridwidth = 1
        self.gbcPanel0.gridheight = 1
        self.gbcPanel0.fill = GridBagConstraints.BOTH
        self.gbcPanel0.weightx = 1
        self.gbcPanel0.weighty = 0
        self.gbcPanel0.anchor = GridBagConstraints.NORTH
        self.gbPanel0.setConstraints(self.blank_8_L, self.gbcPanel0)
        self.panel0.add(self.blank_8_L)

        self.text_editor_BTN = \
            JButton("Open config file", actionPerformed=self.open_text_editor)
        # self.save_Settings_BTN.setPreferredSize(Dimension(1, 20))
        self.rbgPanel0.add(self.text_editor_BTN)
        self.gbcPanel0.gridx = 0
        self.gbcPanel0.gridy = 22
        self.gbPanel0.setConstraints(self.text_editor_BTN, self.gbcPanel0)
        self.panel0.add(self.text_editor_BTN)

        self.add(self.panel0)
Exemplo n.º 29
0
    def getUiComponent(self):
        aws_access_key_id = self.callbacks.loadExtensionSetting(
            "aws_access_key_id")
        aws_secret_accesskey = self.callbacks.loadExtensionSetting(
            "aws_secret_access_key")
        if aws_access_key_id:
            self.aws_access_key_id = aws_access_key_id
        if aws_secret_accesskey:
            self.aws_secret_accesskey = aws_secret_accesskey

        self.panel = JPanel()

        self.main = JPanel()
        self.main.setLayout(BoxLayout(self.main, BoxLayout.Y_AXIS))

        self.access_key_panel = JPanel()
        self.main.add(self.access_key_panel)
        self.access_key_panel.setLayout(
            BoxLayout(self.access_key_panel, BoxLayout.X_AXIS))
        self.access_key_panel.add(JLabel('Access Key: '))
        self.access_key = JTextField(self.aws_access_key_id, 25)
        self.access_key_panel.add(self.access_key)

        self.secret_key_panel = JPanel()
        self.main.add(self.secret_key_panel)
        self.secret_key_panel.setLayout(
            BoxLayout(self.secret_key_panel, BoxLayout.X_AXIS))
        self.secret_key_panel.add(JLabel('Secret Key: '))
        self.secret_key = JPasswordField(self.aws_secret_accesskey, 25)
        self.secret_key_panel.add(self.secret_key)

        self.target_host_panel = JPanel()
        self.main.add(self.target_host_panel)
        self.target_host_panel.setLayout(
            BoxLayout(self.target_host_panel, BoxLayout.X_AXIS))
        self.target_host_panel.add(JLabel('Target host: '))
        self.target_host = JTextField('ifconfig.io', 25)
        self.target_host_panel.add(self.target_host)

        self.buttons_panel = JPanel()
        self.main.add(self.buttons_panel)
        self.buttons_panel.setLayout(
            BoxLayout(self.buttons_panel, BoxLayout.X_AXIS))
        self.save_button = JButton('Save Keys', actionPerformed=self.saveKeys)
        self.buttons_panel.add(self.save_button)
        self.enable_button = JButton('Enable',
                                     actionPerformed=self.enableGateway)
        self.buttons_panel.add(self.enable_button)
        self.disable_button = JButton('Disable',
                                      actionPerformed=self.disableGateway)
        self.buttons_panel.add(self.disable_button)
        self.disable_button.setEnabled(False)

        self.protocol_panel = JPanel()
        self.main.add(self.protocol_panel)
        self.protocol_panel.setLayout(
            BoxLayout(self.protocol_panel, BoxLayout.Y_AXIS))
        self.protocol_panel.add(JLabel("Target Protocol:"))
        self.https_button = JRadioButton("HTTPS", True)
        self.http_button = JRadioButton("HTTP", False)
        self.protocol_panel.add(self.http_button)
        self.protocol_panel.add(self.https_button)
        buttongroup = ButtonGroup()
        buttongroup.add(self.https_button)
        buttongroup.add(self.http_button)

        self.regions_title = JPanel()
        self.main.add(self.regions_title)
        self.regions_title.add(JLabel("Regions to launch API Gateways in:"))

        self.regions_panel = JPanel()
        self.main.add(self.regions_panel)
        glayout = GridLayout(4, 3)
        self.regions_panel.setLayout(glayout)
        for region in AVAIL_REGIONS:
            cur_region = region.replace('-', '_')
            cur_region = cur_region + '_status'
            if cur_region.startswith(
                    "ap") and cur_region != 'ap_east_1_status':
                setattr(self, cur_region, JCheckBox(region, True))
            else:
                setattr(self, cur_region, JCheckBox(region, False))
            attr = getattr(self, cur_region)
            self.regions_panel.add(attr)

        self.status = JPanel()
        self.main.add(self.status)
        self.status.setLayout(BoxLayout(self.status, BoxLayout.X_AXIS))
        self.status_indicator = JLabel(DISABLED, JLabel.CENTER)
        self.status.add(self.status_indicator)

        self.panel.add(self.main)
        return self.panel
Exemplo n.º 30
0
    def getUiComponent(self):
        ui_panel = JPanel()
        ui_panel.setLayout(BoxLayout(ui_panel, BoxLayout.PAGE_AXIS))

        ui_host_line = JPanel()
        ui_host_line.setLayout(BoxLayout(ui_host_line, BoxLayout.LINE_AXIS))
        ui_host_line.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        ui_host_line.add(JLabel("ElasticSearch Host: "))
        self.ui_es_host = JTextField(40)
        self.ui_es_host.setMaximumSize(self.ui_es_host.getPreferredSize())
        self.ui_es_host.setText(self.es_host)
        ui_host_line.add(self.ui_es_host)
        ui_panel.add(ui_host_line)

        ui_index_line = JPanel()
        ui_index_line.setLayout(BoxLayout(ui_index_line, BoxLayout.LINE_AXIS))
        ui_index_line.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        ui_index_line.add(JLabel("ElasticSearch Index: "))
        self.ui_es_index = JTextField(40)
        self.ui_es_index.setText(self.es_index)
        self.ui_es_index.setMaximumSize(self.ui_es_index.getPreferredSize())
        ui_index_line.add(self.ui_es_index)
        ui_panel.add(ui_index_line)

        ui_whitelist_line = JPanel()
        ui_whitelist_line.setLayout(
            BoxLayout(ui_whitelist_line, BoxLayout.LINE_AXIS))
        ui_whitelist_line.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        ui_whitelist_line.add(JLabel("Host whitelist: "))
        self.ui_whitelist = JTextField(40)
        self.ui_whitelist.setText(self.whitelist)
        self.ui_whitelist.setMaximumSize(self.ui_whitelist.getPreferredSize())
        ui_whitelist_line.add(self.ui_whitelist)
        ui_panel.add(ui_whitelist_line)

        ui_tools_panel = JPanel()
        ui_tools_panel.setLayout(
            BoxLayout(ui_tools_panel, BoxLayout.LINE_AXIS))
        ui_tools_panel.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        self.ui_tool_suite = JCheckBox(
            "Suite", self.tools & ECallbacks.TOOL_SUITE != 0)
        ui_tools_panel.add(self.ui_tool_suite)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_target = JCheckBox(
            "Target", self.tools & ECallbacks.TOOL_TARGET != 0)
        ui_tools_panel.add(self.ui_tool_target)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_proxy = JCheckBox(
            "Proxy", self.tools & ECallbacks.TOOL_PROXY != 0)
        ui_tools_panel.add(self.ui_tool_proxy)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_spider = JCheckBox(
            "Spider", self.tools & ECallbacks.TOOL_SPIDER != 0)
        ui_tools_panel.add(self.ui_tool_spider)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_scanner = JCheckBox(
            "Scanner", self.tools & ECallbacks.TOOL_SCANNER != 0)
        ui_tools_panel.add(self.ui_tool_scanner)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_intruder = JCheckBox(
            "Intruder", self.tools & ECallbacks.TOOL_INTRUDER != 0)
        ui_tools_panel.add(self.ui_tool_intruder)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_repeater = JCheckBox(
            "Repeater", self.tools & ECallbacks.TOOL_REPEATER != 0)
        ui_tools_panel.add(self.ui_tool_repeater)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_sequencer = JCheckBox(
            "Sequencer", self.tools & ECallbacks.TOOL_SEQUENCER != 0)
        ui_tools_panel.add(self.ui_tool_sequencer)
        ui_tools_panel.add(Box.createRigidArea(Dimension(10, 0)))
        self.ui_tool_extender = JCheckBox(
            "Extender", self.tools & ECallbacks.TOOL_EXTENDER != 0)
        ui_tools_panel.add(self.ui_tool_extender)
        ui_panel.add(ui_tools_panel)
        ui_panel.add(Box.createRigidArea(Dimension(0, 10)))

        ui_log_line = JPanel()
        ui_log_line.setLayout(BoxLayout(ui_log_line, BoxLayout.LINE_AXIS))
        ui_log_line.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        ui_debug = JRadioButton("DEBUG", self.log_level == 'DEBUG')
        ui_log_line.add(ui_debug)
        ui_log_line.add(Box.createRigidArea(Dimension(10, 0)))
        ui_info = JRadioButton("INFO", self.log_level == 'INFO')
        ui_log_line.add(ui_info)
        ui_log_line.add(Box.createRigidArea(Dimension(10, 0)))
        ui_warning = JRadioButton("WARNING", self.log_level == 'WARNING')
        ui_log_line.add(ui_warning)
        ui_log_line.add(Box.createRigidArea(Dimension(10, 0)))
        ui_error = JRadioButton("ERROR", self.log_level == 'ERROR')
        ui_log_line.add(ui_error)
        ui_log_line.add(Box.createRigidArea(Dimension(10, 0)))
        ui_critical = JRadioButton(
            "CRITICAL", self.log_level == 'CRITICAL')
        ui_log_line.add(ui_critical)
        ui_log_line.add(Box.createRigidArea(Dimension(10, 0)))
        ui_panel.add(ui_log_line)
        ui_panel.add(Box.createRigidArea(Dimension(0, 10)))
        self.ui_log_level = ButtonGroup()
        self.ui_log_level.add(ui_debug)
        self.ui_log_level.add(ui_info)
        self.ui_log_level.add(ui_warning)
        self.ui_log_level.add(ui_error)
        self.ui_log_level.add(ui_critical)

        ui_buttons_line = JPanel()
        ui_buttons_line.setLayout(
            BoxLayout(ui_buttons_line, BoxLayout.LINE_AXIS))
        ui_buttons_line.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        ui_buttons_line.add(
            JButton("Save config", actionPerformed=self.save_config))
        ui_panel.add(ui_buttons_line)

        return ui_panel