Пример #1
0
    def __init__(self, frame, chart, pingFun):
        JDialog(frame)
        self.setTitle('Chart Settings')
        self.setModal(True)
        self.pingFun = pingFun
        pane = self.getRootPane().getContentPane()
        pane.setLayout(GridLayout(7, 2))
        pane.add(JLabel('Marker color'))
        self.markerPanel = self.createColorPanel(chart.markerColor, pane)
        pane.add(JLabel('Positive selection color'))
        self.posPanel = self.createColorPanel(chart.posColor, pane)
        pane.add(JLabel('Neutral color'))
        self.neuPanel = self.createColorPanel(chart.neuColor, pane)
        pane.add(JLabel('Balancing selection color '))
        self.balPanel = self.createColorPanel(chart.balColor, pane)

        self.add(JLabel('Label candidate selected loci'))
        self.selLabel = JCheckBox()
        self.selLabel.setSelected(chart.labelSelected)
        self.add(self.selLabel)
        self.add(JLabel('Label candidate neutral loci'))
        self.neuLabel = JCheckBox()
        self.neuLabel.setSelected(chart.labelNeutral)
        self.add(self.neuLabel)

        change = JButton('Change')
        change.setActionCommand('Change')
        change.addActionListener(self)
        pane.add(change)
        exit = JButton('Exit')
        exit.setActionCommand('Exit')
        exit.addActionListener(self)
        pane.add(exit)
        self.pack()
Пример #2
0
    def initComponents(self):
        self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
        #self.setLayout(GridLayout(0,1))
        self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
        self.panel1 = JPanel()
        self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
        self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
        self.checkbox = JCheckBox("All Logs",
                                  actionPerformed=self.checkBoxEvent)
        self.checkbox1 = JCheckBox("Application.Evtx",
                                   actionPerformed=self.checkBoxEvent)
        self.checkbox2 = JCheckBox("Security.EVTX",
                                   actionPerformed=self.checkBoxEvent)
        self.checkbox3 = JCheckBox("System.EVTX",
                                   actionPerformed=self.checkBoxEvent)
        self.checkbox4 = JCheckBox(
            "Other - Input in text area below then check this box",
            actionPerformed=self.checkBoxEvent)
        self.panel1.add(self.checkbox)
        self.panel1.add(self.checkbox1)
        self.panel1.add(self.checkbox2)
        self.panel1.add(self.checkbox3)
        self.panel1.add(self.checkbox4)
        self.add(self.panel1)

        self.area = JTextArea(5, 25)
        #self.area.addKeyListener(self)
        self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0))
        self.pane = JScrollPane()
        self.pane.getViewport().add(self.area)
        #self.pane.addKeyListener(self)
        #self.add(self.area)
        self.add(self.pane)
Пример #3
0
    def initComponents(self):
        self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
        self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
        self.panel = JPanel()
        self.panel.setLayout(BoxLayout(self.panel, BoxLayout.Y_AXIS))
        self.panel.setAlignmentY(JComponent.LEFT_ALIGNMENT)

        self.labelTop = JLabel("Choose file extensions to look for:")
        self.panel.add(self.labelTop)
        self.checkboxJPG = JCheckBox(".jpg",
                                     actionPerformed=self.checkBoxEvent)
        self.panel.add(self.checkboxJPG)
        self.checkboxJPEG = JCheckBox(".jpeg",
                                      actionPerformed=self.checkBoxEvent)
        self.panel.add(self.checkboxJPEG)
        self.checkboxPNG = JCheckBox(".png",
                                     actionPerformed=self.checkBoxEvent)
        self.panel.add(self.checkboxPNG)
        self.labelBlank = JLabel(" ")
        self.panel.add(self.labelBlank)
        self.checkboxDelete = JCheckBox("Delete files after use",
                                        actionPerformed=self.checkBoxEvent)
        self.panel.add(self.checkboxDelete)
        self.labelBlank1 = JLabel(" ")
        self.panel.add(self.labelBlank1)
        self.label = JLabel(
            "Provide folder for trainning face (if none will only do detection)"
        )
        self.openb = JButton("Choose", actionPerformed=self.onClick)
        self.panel.add(self.label)
        self.panel.add(self.openb)

        self.add(self.panel)
Пример #4
0
    def initComponents(self):
        self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
        #self.setLayout(GridLayout(0,1))
        self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
        self.panel1 = JPanel()
        self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
        self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
        self.checkbox = JCheckBox("Create Content View of Unique Event Id's",
                                  actionPerformed=self.checkBoxEvent)
        self.checkbox4 = JCheckBox(
            "Other - Input in text area below then check this box",
            actionPerformed=self.checkBoxEvent)
        self.text1 = JLabel(
            "*** Only run this once otherwise it adds it to the data again.")
        self.text2 = JLabel(" ")
        self.text3 = JLabel(
            "*** Format is a comma delimited text ie:  8001, 8002")
        self.panel1.add(self.checkbox)
        self.panel1.add(self.text1)
        self.panel1.add(self.text2)
        self.panel1.add(self.checkbox4)
        self.panel1.add(self.text3)
        self.add(self.panel1)

        self.area = JTextArea(5, 25)
        #self.area.addKeyListener(self)
        self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0))
        self.pane = JScrollPane()
        self.pane.getViewport().add(self.area)
        #self.pane.addKeyListener(self)
        #self.add(self.area)
        self.add(self.pane)
Пример #5
0
    def initComponents(self):
        self.setLayout(GridBagLayout())

        gbc = GridBagConstraints()
        gbc.anchor = GridBagConstraints.NORTHWEST
        gbc.gridx = 0
        gbc.gridy = 0

        descriptionLabel = JLabel("FEA - Credit Card module")
        self.add(descriptionLabel, gbc)

        self.cbGenerateExcel = JCheckBox("Generate Excel format report (more detailed)", actionPerformed=self.cbGenerateExcelActionPerformed)
        self.cbGenerateExcel.setSelected(True)
        gbc.gridy = 2
        self.add(self.cbGenerateExcel, gbc)

        self.cbGenerateCSV = JCheckBox("Generate CSV format report (plaintext)", actionPerformed=self.cbGenerateCSVActionPerformed)
        self.cbGenerateCSV.setSelected(True)
        gbc.gridy = 3
        self.add(self.cbGenerateCSV, gbc)

        self.cbRemoveFalsePositives = JCheckBox("Remove False Positives from Autopsy", actionPerformed=self.cbRemoveFalsePositivesActionPerformed)
        self.cbRemoveFalsePositives.setSelected(True)
        gbc.gridy = 4
        self.cbRemoveFalsePositives.setEnabled(False)
        self.add(self.cbRemoveFalsePositives, gbc)
Пример #6
0
    def initComponents(self):
        self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
        # self.setLayout(GridLayout(0,1))
        self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
        panel1 = JPanel()
        panel1.setLayout(BoxLayout(panel1, BoxLayout.Y_AXIS))
        panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
        self.labelPythonPathText = JLabel("Python path: ")
        self.textFieldPythonPath = JTextField(1)
        self.buttonSavePythonPath = JButton("Save", actionPerformed=self.textFieldEventPythonPath)

        self.labelCheckText = JLabel("Run recoveries: ")

        self.checkboxUndark = JCheckBox("Undark", actionPerformed=self.checkBoxEventUndark)
        self.checkboxMdg = JCheckBox("MGD Delete Parser", actionPerformed=self.checkBoxEventMdg)
        self.checkboxCrawler = JCheckBox("WAL Crawler", actionPerformed=self.checkBoxEventCrawler)
        self.checkboxB2l = JCheckBox("bring2lite", actionPerformed=self.checkBoxEventB2l)
        
        self.checkboxUndark.setSelected(True)
        self.checkboxMdg.setSelected(True)
        
        self.add(self.labelPythonPathText)
        panel1.add(self.textFieldPythonPath)
        panel1.add(self.buttonSavePythonPath)

        panel1.add(self.labelCheckText)
        panel1.add(self.checkboxUndark)
        panel1.add(self.checkboxMdg)
        panel1.add(self.checkboxCrawler)
        panel1.add(self.checkboxB2l)
        self.add(panel1)
Пример #7
0
 def getUiComponent(self):
     self.HaEPanel = JPanel()
     self.HaEPanel.setBorder(None)
     self.HaEPanel.setLayout(BorderLayout(0, 0))
     self.panel = JPanel()
     self.HaEPanel.add(self.panel, BorderLayout.NORTH)
     self.panel.setLayout(BorderLayout(0, 0))
     self.tabbedPane = JTabbedPane(JTabbedPane.TOP)
     self.panel.add(self.tabbedPane, BorderLayout.CENTER)
     self.setPanel = JPanel()
     self.tabbedPane.addTab("Set", None, self.setPanel, None)
     self.setPanel.setLayout(BorderLayout(0, 0))
     self.setPanel_1 = JPanel()
     self.setPanel.add(self.setPanel_1, BorderLayout.NORTH)
     self.nameString = JLabel("Name")
     self.setPanel_1.add(self.nameString)
     self.nameTextField = JTextField()
     self.setPanel_1.add(self.nameTextField)
     self.nameTextField.setColumns(10)
     self.regexString = JLabel("Regex")
     self.setPanel_1.add(self.regexString)
     self.regexTextField = JTextField()
     self.setPanel_1.add(self.regexTextField)
     self.regexTextField.setColumns(10)
     self.extractCheckBox = JCheckBox("Extract")
     self.setPanel_1.add(self.extractCheckBox)
     self.highlightCheckBox = JCheckBox("Highlight")
     self.setPanel_1.add(self.highlightCheckBox)
     self.setPanel_2 = JPanel()
     self.setPanel.add(self.setPanel_2)
     self.colorString = JLabel("Color")
     self.setPanel_2.add(self.colorString)
     self.colorTextField = JTextField()
     self.setPanel_2.add(self.colorTextField)
     self.colorTextField.setColumns(5)
     self.addBottun = JButton("Add", actionPerformed=self.addConfig)
     self.setPanel_2.add(self.addBottun)
     self.tipString = JLabel("")
     self.setPanel_2.add(self.tipString)
     self.configPanel = JPanel()
     self.tabbedPane.addTab("Config", None, self.configPanel, None)
     self.configPanel.setLayout(BorderLayout(0, 0))
     self.configString = JLabel("This is config file content.")
     self.configString.setHorizontalAlignment(SwingConstants.CENTER)
     self.configPanel.add(self.configString, BorderLayout.NORTH)
     self.configTextArea = JTextArea()
     self.configTextArea.setEnabled(False)
     self.configTextArea.setTabSize(4)
     self.configTextArea.setLineWrap(True)
     self.configTextArea.setRows(20)
     self.configPanel.add(self.configTextArea, BorderLayout.SOUTH)
     self.scrollPane = JScrollPane(self.configTextArea)
     self.configPanel.add(self.scrollPane, BorderLayout.SOUTH)
     self.reloadButton = JButton("Reload",
                                 actionPerformed=self.reloadConfig)
     self.configPanel.add(self.reloadButton, BorderLayout.CENTER)
     return self.HaEPanel
Пример #8
0
 def initComponents(self):
     self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
     self.cache_parse_checkbox = JCheckBox(
         "Parse Cached Files", actionPerformed=self.cache_checkbox_event)
     self.add(self.cache_parse_checkbox)
     self.settings_parse_checkbox = JCheckBox(
         "Parse Setting Files",
         actionPerformed=self.settings_checkbox_event)
     self.add(self.settings_parse_checkbox)
Пример #9
0
    def initConfigurationTab(self):
        #
        ##  init configuration tab
        #
        self.prevent304 = JCheckBox("Prevent 304 Not Modified status code")
        self.prevent304.setBounds(290, 25, 300, 30)

        self.ignore304 = JCheckBox("Ignore 304/204 status code responses")
        self.ignore304.setBounds(290, 5, 300, 30)
        self.ignore304.setSelected(True)

        self.autoScroll = JCheckBox("Auto Scroll")
        #self.autoScroll.setBounds(290, 45, 140, 30)
        self.autoScroll.setBounds(160, 40, 140, 30)

        self.doUnauthorizedRequest = JCheckBox("Check unauthenticated")
        self.doUnauthorizedRequest.setBounds(290, 45, 300, 30)
        self.doUnauthorizedRequest.setSelected(True)

        startLabel = JLabel("Authorization checks:")
        startLabel.setBounds(10, 10, 140, 30)
        self.startButton = JButton("Autorize is off",
                                   actionPerformed=self.startOrStop)
        self.startButton.setBounds(160, 10, 120, 30)
        self.startButton.setBackground(Color(255, 100, 91, 255))

        self.clearButton = JButton("Clear List",
                                   actionPerformed=self.clearList)
        self.clearButton.setBounds(10, 40, 100, 30)

        self.replaceString = JTextArea("Cookie: Insert=injected; header=here;",
                                       5, 30)
        self.replaceString.setWrapStyleWord(True)
        self.replaceString.setLineWrap(True)
        self.replaceString.setBounds(10, 80, 470, 180)

        self.filtersTabs = JTabbedPane()
        self.filtersTabs.addTab("Enforcement Detector", self.EDPnl)
        self.filtersTabs.addTab("Detector Unauthenticated", self.EDPnlUnauth)
        self.filtersTabs.addTab("Interception Filters", self.filtersPnl)
        self.filtersTabs.addTab("Export", self.exportPnl)

        self.filtersTabs.setBounds(0, 280, 2000, 700)

        self.pnl = JPanel()
        self.pnl.setBounds(0, 0, 1000, 1000)
        self.pnl.setLayout(None)
        self.pnl.add(self.startButton)
        self.pnl.add(self.clearButton)
        self.pnl.add(self.replaceString)
        self.pnl.add(startLabel)
        self.pnl.add(self.autoScroll)
        self.pnl.add(self.ignore304)
        self.pnl.add(self.prevent304)
        self.pnl.add(self.doUnauthorizedRequest)
        self.pnl.add(self.filtersTabs)
    def initComponents(self):
        self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
        self.file_checkbox = JCheckBox("Look for Files relating to Dropbox",
                                       actionPerformed=self.checkBoxEvent)
        self.add(self.file_checkbox)

        self.dir_checkbox = JCheckBox(
            "Look for Directories relating to Dropbox",
            actionPerformed=self.checkBoxEvent)
        self.add(self.dir_checkbox)
Пример #11
0
 def build_options_row(self):
     '''
     Builds the panel with ignore case, regex, etc. options.
     '''
     panel = JPanel(FlowLayout())
     self.ignore_case_box = JCheckBox('Ignore Case')
     self.regex_box = JCheckBox('Regular Expression')
     self.selection_box = JCheckBox('Selection only')
     panel.add(self.ignore_case_box)
     panel.add(self.regex_box)
     panel.add(self.selection_box)
     return panel
Пример #12
0
    def __init__(self, extender):
        self._callbacks = extender._callbacks
        self._helpers = extender._callbacks.getHelpers()
        self._callbacks.registerScannerCheck(self)
        # Creamos el contenedor de paneles.
        self.contenedor = JTabbedPane()

        # Campos del sub-tab 1 (mash up)
        self._tab1_nombre = JTextField()
        self._tab1_apellido = JTextField()
        self._tab1_FNacimiento = JTextField()
        self._tab1_mascota = JTextField()
        self._tab1_otro = JTextField()

        self._tab1_feedback_ta = JTextArea('This may take a while . . .')
        self._tab1_feedback_ta.setEditable(False)
        self._tab1_feedback_sp = JScrollPane(self._tab1_feedback_ta)

        self._tab1_minsize = JSlider(4, 16, 6)
        self._tab1_minsize.setMajorTickSpacing(1)
        self._tab1_minsize.setPaintLabels(True)

        self._tab1_maxsize = JSlider(4, 16, 10)
        self._tab1_maxsize.setMajorTickSpacing(1)
        self._tab1_maxsize.setPaintLabels(True)

        self._tab1_specialchars = JTextField('!,@,#,$,&,*')
        self._tab1_transformations = JCheckBox('1337 mode')
        self._tab1_firstcapital = JCheckBox('first capital letter')

        # Campos del sub-tab 2 (redirect)
        self._tab2_JTFa = JTextField()
        self._tab2_JTFaa = JTextField()
        self._tab2_JTFb = JTextField()
        self._tab2_JTFbb = JTextField()
        self._tab2_boton = JButton(' Redirect is Off ',
                                   actionPerformed=self.switch_redirect)
        self._tab2_boton.background = Color.lightGray
        self._tab2_encendido = False

        # Campos del sub-tab 3 (loader)
        self._tab3_urls_ta = JTextArea(15, 5)
        self._tab3_urls_sp = JScrollPane(self._tab3_urls_ta)

        # Campos del sub-tab 4 (headers)
        self._tab4_tabla_model = DefaultTableModel()
        self._tab4_headers_dict = {}

        # Campos del sub-tab 5 (reverse ip)
        self._tab5_target = JTextArea(15, 5)
        self._tab5_target_sp = JScrollPane(self._tab5_target)
Пример #13
0
 def __init__(self, chartFun, isTemporal = False):
     self.isTemporal = isTemporal
     JPanel()
     #self.setBackground(Color.LIGHT_GRAY)
     self.chartFun = chartFun
     self.enableChartFun = False
     self.setLayout(GridLayout(6,2))
     self.add(JLabel('CPU Cores'))
     nprocs = ManagementFactory.getOperatingSystemMXBean().getAvailableProcessors()
     procvals = sorted(set([nprocs, 1, 2, 4, 8, 16, 32, 64, 128]))
     cores = JComboBox(procvals)
     cores.setSelectedIndex(procvals.index(nprocs))
     cores.setMaximumSize(cores.getPreferredSize())
     self.cores = cores
     self.add(self.cores)
     self.add(JLabel('# of sims (x1000)  '))
     numSims = JComboBox(
         map(lambda x: str((10+x)*5), range(10)) +
         map(lambda x: str(x*100), range(1,11))
     )
     numSims.setMaximumSize(numSims.getPreferredSize())
     self.numSims = numSims
     self.add(self.numSims)
     if isTemporal:
         self.add(JLabel('"Neutral" Ne'))
         self.neutral = JCheckBox()
         self.neutral.addActionListener(self)
         self.add(self.neutral)
     else:
         self.add(JLabel('"Neutral" mean Fst'))
         self.neutral = JCheckBox()
         self.neutral.addActionListener(self)
         self.add(self.neutral)
         self.add(JLabel('Force mean Fst'))
         self.force = JCheckBox()
         self.force.addActionListener(self)
         self.add(self.force)
     self.add(JLabel('Confidence interval '))
     ci = JComboBox(['0.95', '0.99', '0.995'])
     ci.addItemListener(self)
     ci.setMaximumSize(cores.getPreferredSize())
     self.ci = ci
     self.add(self.ci)
     self.add(JLabel('False Disc. Rate'))
     fdr = JFormattedTextField(
         NumberFormat.getNumberInstance(Locale.US))
     fdr.setValue(0.1)
     fdr.addPropertyChangeListener(self)
     self.add(fdr)
     self.fdr = fdr
Пример #14
0
    def initializeGUI(self):
        # table panel of scope entries
        self._url_table = Table(self)
        table_popup = JPopupMenu();
        remove_item_menu = JMenuItem(self._remove_description, actionPerformed=self.removeFromScope)
        table_popup.add(remove_item_menu)
        self._url_table.setComponentPopupMenu(table_popup)
        self._url_table.addMouseListener(TableMouseListener(self._url_table))
        scrollPane = JScrollPane(self._url_table)

        # setting panel              

        ##  locate checkboxes
        ### for constants, see: https://portswigger.net/burp/extender/api/constant-values.html#burp.IBurpExtenderCallbacks.TOOL_PROXY          
        self._checkboxes = {
            2:    JCheckBox('Target'),
            4:    JCheckBox('Proxy'),
            8:    JCheckBox('Spider'),
            16:   JCheckBox('Scanner'),
            32:   JCheckBox('Intruder'),            
            64:   JCheckBox('Repeater'),
            128:  JCheckBox('Sequencer'),
            1024: JCheckBox('Extender')
        }
        checkboxes_components = {0: dict(zip(range(1,len(self._checkboxes) + 1), self._checkboxes.values()))}

        self._label_value_regex_now_1 = JLabel("(1) Regex for the value to store: ")
        self._label_value_regex_now_2 = JLabel("")
        self._label_value_regex = JLabel("(1) New regex:")
        self._form_value_regex = JTextField("", 64)
        self._button_value_regex = JButton('Update', actionPerformed=self.updateTokenSourceRegex)        
        self._label_header_now_1 = JLabel("(2) Header for sending the value: ")
        self._label_header_now_2 = JLabel("")
        self._label_header = JLabel("(2) New header key: ")
        self._form_header = JTextField("", 64)
        self._button_header = JButton('Update', actionPerformed=self.updateHeaderName)
        self._label_add_url = JLabel("Add this URL: ")
        self._form_add_url = JTextField("", 64)
        self._button_add_url = JButton('Add', actionPerformed=self.addURLDirectly)
                
        ## logate regex settings
        ui_components_for_settings_pane = {
            0: { 0: JLabel("Local Settings:") },
            1: { 0: self._label_value_regex_now_1, 1: self._label_value_regex_now_2 },
            2: { 0: self._label_value_regex, 1: self._form_value_regex, 2: self._button_value_regex},
            3: { 0: self._label_header_now_1, 1: self._label_header_now_2 },
            4: { 0: self._label_header, 1: self._form_header, 2: self._button_header},
            5: { 0: {'item': JSeparator(JSeparator.HORIZONTAL), 'width': 3, }},
            6: { 0: JLabel("General Settings:") },
            7: { 0: self._label_add_url, 1: self._form_add_url, 2: self._button_add_url},
            8: { 0: JLabel("Use this extender in:"), 1: {'item': self.compose_ui(checkboxes_components), 'width': 3} }
        }
        # build a split panel & set UI component
        self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
        self._splitpane.setResizeWeight(0.85)
        self._splitpane.setLeftComponent(scrollPane)
        self._splitpane.setRightComponent(self.compose_ui(ui_components_for_settings_pane))
        self._callbacks.customizeUiComponent(self._splitpane)
Пример #15
0
 def addApplicationCheckbox(app, app_id, ap):
     checkbox = JCheckBox("{} ({})".format(app.capitalize(), app_id), actionPerformed= ap)
     checkbox.setActionCommand(app)
     checkbox.setSelected(True)
     checkbox.setVisible(False)
     checkbox.setActionCommand(app_id)
     return checkbox
Пример #16
0
    def initComponents(self):
        self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
        self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
        self.panel1 = JPanel()
        self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
        self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
        self.checkbox = JCheckBox("Искать таблицы?".decode('UTF-8'),
                                  actionPerformed=self.checkBoxEvent)
        self.label0 = JLabel(" ")
        self.label1 = JLabel(
            "Введите названия интересуемых таблиц".decode('UTF-8'))
        self.label2 = JLabel(
            "через запятую, после чего установите флажок".decode('UTF-8'))
        self.label3 = JLabel(" ")
        self.panel1.add(self.checkbox)
        self.panel1.add(self.label0)
        self.panel1.add(self.label1)
        self.panel1.add(self.label2)
        self.panel1.add(self.label3)
        self.add(self.panel1)
        self.local_settings.setSetting('Flag', 'false')

        self.area = JTextArea(5, 25)
        self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0))
        self.pane = JScrollPane()
        self.pane.getViewport().add(self.area)
        self.add(self.pane)
Пример #17
0
    def p_build_ui(self, event):
        """
        Adds a list of checkboxes, one for each loaded plugin
        to the Selct plugins window
        """
        if not self.loaded_p_list:
            self.update_scroll("[!!] No plugins loaded!")
            return

        scroll_pane = JScrollPane()
        scroll_pane.setPreferredSize(Dimension(200, 250))
        check_frame = JPanel(GridBagLayout())
        constraints = GridBagConstraints()
        constraints.fill = GridBagConstraints.HORIZONTAL
        constraints.gridy = 0
        constraints.anchor = GridBagConstraints.FIRST_LINE_START

        for plug in self.loaded_p_list:
            check_frame.add(JCheckBox(plug.get_name(), plug.enabled,
                                      actionPerformed=self.update_box),
                            constraints)
            constraints.gridy += 1

        vport = JViewport()
        vport.setView(check_frame)
        scroll_pane.setViewport(vport)
        self.window.contentPane.add(scroll_pane)
        self.window.pack()
        self.window.setVisible(True)
Пример #18
0
    def __init__(self):
        DefaultTreeCellRenderer.__init__(self)

        flowLayout = FlowLayout(FlowLayout.LEFT, 0, 0)

        self.cbPanel = JPanel(flowLayout)
        self.cb = JCheckBox()
        self.cb.setBackground(None)
        self.cbPanel.add(self.cb)
        self.cbLabel = JLabel()
        self.cbPanel.add(self.cbLabel)

        self.tcbPanel = JPanel(flowLayout)
        self.tcb = TristateCheckBox()
        self.tcb.setBackground(None)
        self.tcbPanel.add(self.tcb)
        self.tcbLabel = JLabel()
        self.tcbPanel.add(self.tcbLabel)

        self.rbPanel = JPanel(flowLayout)
        self.rb = JRadioButton()
        self.rb.setBackground(None)
        self.rbPanel.add(self.rb)
        self.rbLabel = JLabel()
        self.rbPanel.add(self.rbLabel)
Пример #19
0
    def __init__(self, tree):
        TreeCellEditor.__init__(self)
        self.editor = None
        self.tree = tree

        flowLayout = FlowLayout(FlowLayout.LEFT, 0, 0)

        self.cbPanel = JPanel(flowLayout)
        self.cb = JCheckBox(actionPerformed=self.checked)
        self.cbPanel.add(self.cb)
        self.cbLabel = JLabel()
        self.cbPanel.add(self.cbLabel)

        self.tcbPanel = JPanel(flowLayout)
        self.tcb = TristateCheckBox(self.checked)
        self.tcbPanel.add(self.tcb)
        self.tcbLabel = JLabel()
        self.tcbPanel.add(self.tcbLabel)

        self.rbPanel = JPanel(flowLayout)
        self.rb = JRadioButton(actionPerformed=self.checked)
        self.rbPanel.add(self.rb)
        self.rbLabel = JLabel()
        self.rbPanel.add(self.rbLabel)

        self.tfPanel = JPanel(flowLayout)
        self.tfLabel = JLabel()
        self.tfPanel.add(self.tfLabel)
        self.tf = JTextField()
        self.tf.setColumns(12)
        self.tf.addActionListener(self)
        self.tfPanel.add(self.tf)
    def initComponents(self):
        self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
        #self.setLayout(GridLayout(0,1))
        self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
        self.panel1 = JPanel()
        self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
        self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
        self.checkbox = JCheckBox("Check to activate/deactivate TextArea",
                                  actionPerformed=self.checkBoxEvent)
        self.label0 = JLabel(" ")
        self.label1 = JLabel("Input in SQLite DB's in area below,")
        self.label2 = JLabel("seperate values by commas.")
        self.label3 = JLabel("then check the box above.")
        self.label4 = JLabel(" ")
        self.panel1.add(self.checkbox)
        self.panel1.add(self.label0)
        self.panel1.add(self.label1)
        self.panel1.add(self.label2)
        self.panel1.add(self.label3)
        self.panel1.add(self.label4)
        self.add(self.panel1)

        self.area = JTextArea(5, 25)
        #self.area.getDocument().addDocumentListener(self.area)
        #self.area.addKeyListener(listener)
        self.area.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0))
        self.pane = JScrollPane()
        self.pane.getViewport().add(self.area)
        #self.pane.addKeyListener(self.area)
        #self.add(self.area)
        self.add(self.pane)
    def __init__(self, tree, mapContext):
        self.tree = tree
        self.mapContext = mapContext
        self.lblGroup = JLabel()
        self.lblGroup.setBackground(Color(222, 227, 233))  #.BLUE.brighter())
        self.lblGroup.setOpaque(True)
        self.lblGroup.setText(
            "plddddddddddddddddddddddddddddddddddddddddddddddddddddddd")
        self.lblGroupPreferredSize = self.lblGroup.getPreferredSize()
        #border = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)
        #border = BorderFactory.createLineBorder(Color(222,227,233).darker(),1)
        #self.lblGroup.setBorder(border)
        #self.lblGroupPreferredSize.setSize(30,200)#self.lblGroupPreferredSize.getHeight()+4, self.lblGroupPreferredSize.getWidth())
        self.pnlLayer = JPanel()
        self.pnlLayer.setOpaque(False)
        #self.pnlLayer.setBorder(EmptyBorder(2,2,2,2))

        self.pnlLayer.setLayout(FlowLayout(FlowLayout.LEFT))
        self.chkLayerVisibility = JCheckBox()
        self.chkLayerVisibility.setOpaque(False)
        self.pnlLayer.add(self.chkLayerVisibility)
        self.lblLayerIcon = JLabel()
        self.lblLayerName = JLabel()
        self.lblLayerName.setText(
            "plddddddddddddddddddddddddddddddddddddddddddddddddddddddd")

        self.tree.setRowHeight(
            int(self.pnlLayer.getPreferredSize().getHeight()) - 3)  #+2
        self.pnlLayer.add(self.lblLayerIcon)
        self.pnlLayer.add(self.lblLayerName)

        self.lblUnknown = JLabel()
Пример #22
0
 def run(self):
     frame = JFrame('ComponentEventDemo',
                    locationRelativeTo=None,
                    defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
     cp = frame.getContentPane()
     cp.setLayout(BorderLayout())
     self.display = JTextArea(editable=0,
                              font=Font('Courier', Font.PLAIN, 12))
     myListener = listener(self.display)
     frame.addComponentListener(myListener)
     scrollPane = JScrollPane(self.display,
                              preferredSize=Dimension(350, 210))
     cp.add(scrollPane, BorderLayout.CENTER)
     panel = JPanel(BorderLayout(), componentListener=myListener)
     self.button = JButton('Clear',
                           actionPerformed=self.clear,
                           componentListener=myListener)
     panel.add(self.button, BorderLayout.CENTER)
     visible = JCheckBox('Button visible',
                         selected=1,
                         itemStateChanged=self.showHide,
                         componentListener=myListener)
     panel.add(visible, BorderLayout.PAGE_END)
     cp.add(panel, BorderLayout.PAGE_END)
     frame.pack()
     frame.setVisible(1)
Пример #23
0
 def _prepare_components(self, values):
     for scope_tool in Application.SCOPE_TOOLS:
         check_box = JCheckBox(scope_tool)
         check_box.setSelected(scope_tool in values['scope_tools'])
         check_box.addItemListener(self)
         self._check_boxes.append(check_box)
         self.add(check_box)
Пример #24
0
 def display(self, values):
     self.add(JLabel('<html><b>Statuses:</b></html>'))
     for status in Application.ITEM_STATUSES:
         check_box = JCheckBox(status)
         check_box.setSelected(status in values['statuses'])
         check_box.addItemListener(self)
         self._check_boxes.append(check_box)
         self.add(check_box)
Пример #25
0
 def addCB(self, pane, text):
     pane.add(
         JCheckBox(
             text,
             font=("Comic Sans MS", 30, 30),
             itemStateChanged=self.toggle  # even handler
         )
     )
 def initComponents(self):
     self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
     self.db_parse_checkbox = JCheckBox(
         "Parse Database Logs", actionPerformed=self.db_checkbox_event)
     self.add(self.db_parse_checkbox)
     self.settings_parse_checkbox = JCheckBox(
         "Parse Setting Files",
         actionPerformed=self.settings_checkbox_event)
     self.add(self.settings_parse_checkbox)
     self.logs_parse_checkbox = JCheckBox(
         "Parse Logs in Media Folder",
         actionPerformed=self.logs_checkbox_event)
     self.add(self.logs_parse_checkbox)
     self.network_parse_checkbox = JCheckBox(
         "Parse Network Logs (filename has to be: ismart_diag.stream)",
         actionPerformed=self.network_checkbox_event)
     self.add(self.network_parse_checkbox)
Пример #27
0
 def initComponents(self):
     self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
     #self.setLayout(GridLayout(0,1))
     self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
     self.panel1 = JPanel()
     self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
     self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
     self.checkbox = JCheckBox("Associate File Entries",
                               actionPerformed=self.checkBoxEvent)
     self.checkbox1 = JCheckBox("Program Entries",
                                actionPerformed=self.checkBoxEvent)
     self.checkbox2 = JCheckBox("Unassociated Programs",
                                actionPerformed=self.checkBoxEvent)
     self.panel1.add(self.checkbox)
     self.panel1.add(self.checkbox1)
     self.panel1.add(self.checkbox2)
     self.add(self.panel1)
Пример #28
0
    def getUiComponent(self):
        self.panel = JPanel()
        self.panel.setLayout(BoxLayout(self.panel, BoxLayout.PAGE_AXIS))

        self.uiCommandLine = JPanel()
        self.uiCommandLine.setLayout(
            BoxLayout(self.uiCommandLine, BoxLayout.LINE_AXIS))
        self.uiCommandLine.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        self.uiCommandLine.add(JLabel("Command line for local search: "))
        self.uiCommand = JTextField(40)
        self.uiCommand.setMaximumSize(self.uiCommand.getPreferredSize())
        self.uiCommandLine.add(self.uiCommand)
        self.panel.add(self.uiCommandLine)

        uiOptionsLine = JPanel()
        uiOptionsLine.setLayout(BoxLayout(uiOptionsLine, BoxLayout.LINE_AXIS))
        uiOptionsLine.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        self.uiHaveIBeenPwnd = JCheckBox("haveibeenpwned")
        uiOptionsLine.add(self.uiHaveIBeenPwnd)
        uiOptionsLine.add(Box.createRigidArea(Dimension(10, 0)))

        self.uiLocalCheck = JCheckBox("Local check")
        uiOptionsLine.add(self.uiLocalCheck)
        uiOptionsLine.add(Box.createRigidArea(Dimension(10, 0)))
        self.panel.add(uiOptionsLine)
        self.panel.add(Box.createRigidArea(Dimension(0, 10)))

        uiButtonsLine = JPanel()
        uiButtonsLine.setLayout(BoxLayout(uiButtonsLine, BoxLayout.LINE_AXIS))
        uiButtonsLine.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        uiButtonsLine.add(JButton("Apply", actionPerformed=self.applyConfigUI))
        uiButtonsLine.add(JButton("Reset", actionPerformed=self.resetConfigUI))
        self.panel.add(uiButtonsLine)

        self.uiAbout = JPanel()
        self.uiAbout.setLayout(BoxLayout(self.uiAbout, BoxLayout.LINE_AXIS))
        self.uiAbout.setAlignmentX(JPanel.LEFT_ALIGNMENT)
        self.uiAbout.add(
            JLabel(
                "<html><a href=\"https://twitter.com/_chipik\">https://twitter.com/_chipik</a></html>"
            ))
        self.panel.add(self.uiAbout)

        self.resetConfigUI(None)
        return self.panel
Пример #29
0
 def initComponents(self):
     self.setLayout(BoxLayout(self, BoxLayout.Y_AXIS))
     #self.setLayout(GridLayout(0,1))
     self.setAlignmentX(JComponent.LEFT_ALIGNMENT)
     self.panel1 = JPanel()
     self.panel1.setLayout(BoxLayout(self.panel1, BoxLayout.Y_AXIS))
     self.panel1.setAlignmentY(JComponent.LEFT_ALIGNMENT)
     self.checkbox = JCheckBox("All Logs",
                               actionPerformed=self.checkBoxEvent)
     self.checkbox1 = JCheckBox("Application Resource Usage",
                                actionPerformed=self.checkBoxEvent)
     self.checkbox2 = JCheckBox("Energy Estimation Provider",
                                actionPerformed=self.checkBoxEvent)
     self.checkbox3 = JCheckBox("Energy Usage Data",
                                actionPerformed=self.checkBoxEvent)
     self.checkbox4 = JCheckBox("Network Connectivity",
                                actionPerformed=self.checkBoxEvent)
     self.checkbox5 = JCheckBox("Network Usage",
                                actionPerformed=self.checkBoxEvent)
     self.checkbox6 = JCheckBox("Windows Push Notification",
                                actionPerformed=self.checkBoxEvent)
     self.panel1.add(self.checkbox)
     self.panel1.add(self.checkbox1)
     self.panel1.add(self.checkbox2)
     self.panel1.add(self.checkbox3)
     self.panel1.add(self.checkbox4)
     self.panel1.add(self.checkbox5)
     self.panel1.add(self.checkbox6)
     self.add(self.panel1)
Пример #30
0
    def make_chf_panel(self):
        """ chf --> common hseg files """

        chf_panel = JPanel()
        chf_panel.setLayout(MigLayout('insets 0'))

        chf_files_label = JLabel('Hemisegment cells')
        chf_files_text = JTextArea(
            BobGui.archetype_to_str(
                self.exper.hseg_cell_files_cab().archetype))

        chf_panel.add(chf_files_label, 'growx, wrap')
        chf_panel.add(chf_files_text, 'grow, wrap')

        chf_files_label = JLabel('Hemisegment binary image files')
        chf_files_text = JTextArea(
            BobGui.archetype_to_str(self.exper.hseg_bin_files_cab().archetype))

        chf_panel.add(chf_files_label, 'growx, wrap')
        chf_panel.add(chf_files_text, 'grow, wrap')

        chf_files_label = JLabel('Intensity Image Files')
        # chf_files_text = JTextArea(BobGui.archetype_to_str(self.exper.hseg_intens_im_files_cab().archetype))
        # print(self.exper.hseg_intens_im_files_cab().archetype)

        # chf_panel.add(chf_files_label, 'growx, wrap')
        # chf_panel.add(chf_files_text, 'grow, wrap')

        self.intens_im_boxes = []
        intens_im_panel = JPanel()
        intens_im_panel.setLayout(MigLayout('insets 0'))
        for poss_im_file in self.exper.hseg_intens_im_files_cab().archetype:
            self.intens_im_boxes.append(JCheckBox(poss_im_file))
            intens_im_panel.add(self.intens_im_boxes[-1], 'wrap')

        chf_panel.add(chf_files_label, 'growx, wrap')
        chf_panel.add(intens_im_panel, 'grow, wrap')

        mdf_create_button = JButton(
            'Create meta_data file from default outline')
        # mdf_create_button = JButton('<html>Create meta_data file<br>from default outline</html>')
        mdf_create_button.addActionListener(
            ActionListenerFactory(self, self.mdf_create_al))
        mdf_open_button = JButton('Open existing meta_data file')
        mdf_open_button.addActionListener(
            ActionListenerFactory(self, self.mdf_open_al))

        # meta_data_file_buttton = JButton('Open/Create meta_data file')
        # meta_data_file_buttton.addActionListener(ActionListenerFactory(self, self.meta_data_al))

        # chf_panel.add(meta_data_file_buttton)
        chf_panel.add(mdf_create_button, 'wrap')
        chf_panel.add(mdf_open_button, 'wrap')
        chf_scroll_pane = JScrollPane()
        chf_scroll_pane.getViewport().setView(chf_panel)

        return chf_scroll_pane