def addComponents( self, container ) : container.setLayout( GridBagLayout() ) c = GridBagConstraints() c.gridx = 0 # first column c.gridy = 0 # first row container.add( JButton( '1' ), c ) c = GridBagConstraints() c.gridx = 1 # second column c.gridy = 1 # second row container.add( JButton( '2' ), c ) c = GridBagConstraints() c.fill = GridBagConstraints.HORIZONTAL c.gridx = 2 # third column c.gridy = 2 # third row # c.ipadx = 64 # specify (don't default) width c.weightx = 0.0 c.gridwidth = 3 container.add( JButton( '3 being the third number' ), c ) c = GridBagConstraints() c.gridx = 1 # second column c.gridy = 3 # forth row c.ipady = 32 # make this one taller container.add( JButton( 'Four shalt thou not count' ), c ) c = GridBagConstraints() c.gridx = 1 # second column c.gridy = 4 # fifth row c.gridwidth = 3 # make this one 3 columns wide container.add( JButton( 'Five is right out' ), c )
def getTestingPane(self): def openTesting(event): file = JFileChooser() file.showOpenDialog(self) val = file.showOpenDialog(self) if (val == JFileChooser.APPROVE_OPTION): f = file.getSelectedFile() #print f.getName() tb.append(f.getName() + ' selected \n') def runTest(event): print "test running" t = TitledBorder('Testing') p = JPanel(GridBagLayout()) c = GridBagConstraints(anchor=WEST) p.add(JLabel('Choose file for testing: '), c) c = GridBagConstraints(gridx=1, gridy=0, anchor=EAST) b = JButton('Open file', actionPerformed=openTesting) p.add(b, c) c = GridBagConstraints(gridx=0, gridy=2, gridwidth=2, anchor=WEST) test = JButton('Test', actionPerformed=runTest) p.add(test, c) c = GridBagConstraints(gridx=0, gridy=3, anchor=WEST) p.add(JLabel('Display'), c) c = GridBagConstraints(gridx=0, gridy=4, gridwidth=2, fill=GridBagConstraints.HORIZONTAL) tb = JTextArea(rows=9) scroll = JScrollPane(tb) p.add(scroll, c) p.setBorder(t) return p
def addComponents(self, container): container.setLayout(GridBagLayout()) names = '1,2,3 being the third number'.split(',') for col in range(len(names)): c = GridBagConstraints() c.gridx = col # gridx is the grid column c.gridy = col # gridy is the grid row # container.add(JButton(names[col]), c) c = GridBagConstraints() c.gridx = 1 c.gridy = 3 # put this one on the next row c.ipady = 32 # make this one taller container.add(JButton('Four shalt thou not count'), c)
def addStatusLabel(self, msg): gbc = GridBagConstraints() gbc.anchor = GridBagConstraints.NORTHWEST gbc.gridx = 0 gbc.gridy = 7 lab = JLabel(msg) self.add(lab, gbc)
def tagLoad(self): # 创建窗口 开始 self.tabs = JTabbedPane() self.settings = JPanel(GridBagLayout()) self.forward_requests_settings = JPanel(GridBagLayout()) self.white_list_domain_settings = JPanel(GridBagLayout()) c = GridBagConstraints() # 界面选项卡1-标签加载 self.tag_1(c) self.tag_2(c) # 界面选项卡2-标签加载 self.tag_3(c) self.tag_4(c) # 界面选项卡3-标签加载 self.tag_5(c) # 添加选项卡 self.tabs.addTab(u'基本设置', self.settings) self.tabs.addTab(u'http请求转发设置', self.forward_requests_settings) self.tabs.addTab(u'白名单域名设置', self.white_list_domain_settings) self._callbacks.customizeUiComponent(self.tabs) self._callbacks.addSuiteTab(self)
def createEditorComponent(self, properties): p = JPanel(GridBagLayout()) p.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)) gbc = GridBagConstraints() gbc.gridx = 0 gbc.gridy = 0 gbc.weightx = 0.0 gbc.weighty = 0.0 gbc.fill = GridBagConstraints.HORIZONTAL gbc.insets = Insets(3, 3, 3, 3) p.add(JLabel("Prompt:"), gbc) gbc.gridx = 1 editor = NodePropertiesDialog.createTextArea(properties, self.PROMPT) p.add(editor, gbc) gbc.gridx, gbc.gridy = 1, 0 p.add( NodePropertiesDialog.createCheckBox(properties, self.WAIT, "Wait until done"), gbc) jtp = JTabbedPane() jtp.addTab("Output", p) return jtp
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)
def __init__(self, plugin): super(EmulatorComponentProvider, self).__init__(plugin.getTool(), "Emulator", "emulate_function") self.plugin = plugin self.panel = JPanel(GridBagLayout()) c = GridBagConstraints() c.fill = GridBagConstraints.HORIZONTAL c.gridy = 0 c.gridx = 0 c.weightx = 0.8 self.panel_label = JLabel("") self.panel.add(self.panel_label, c) c.gridx = 1 c.weightx = 0.2 self.panel_btn = JButton("Start") self.panel_btn.addActionListener(EmulatorBtnAction(self)) self.panel.add(self.panel_btn, c) c.gridy = 1 c.gridx = 0 c.gridwidth = 2 self.panel_input = JTextField() self.panel_input.addActionListener(EmulatorInputAction(self)) self.panel.add(self.panel_input, c) self.setStatus("Stopped")
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)
def addComponents( self, container ) : container.setLayout( GridBagLayout() ) names = '1,2,3 being the third number'.split( ',' ) for col in range( len( names ) ) : c = GridBagConstraints() container.add( JButton( names[ col ] ), c )
def __createDropDownConstraints(self): constr = GridBagConstraints() constr.fill = GridBagConstraints.HORIZONTAL constr.weighty = 1 constr.gridwidth = 4 constr.gridx = 0 constr.gridy = 0 return constr
def __createTableConstraints(self): constr = GridBagConstraints() constr.fill = GridBagConstraints.BOTH constr.weighty = 1000 constr.weightx = 2 constr.gridwidth = 4 constr.gridx = 0 constr.gridy = 2 return constr
def __createRadioConstraints(self, mode): constr = GridBagConstraints() constr.fill = GridBagConstraints.HORIZONTAL constr.weighty = 1 constr.weightx = 1 if mode == 'cases': constr.gridx = 2 elif mode == 'commands': constr.gridx = 3 constr.gridy = 1 return constr
def __setupLayout(self): self.setLayout(GridBagLayout()) constr = GridBagConstraints() constr.weighty = 1 constr.weightx = 1 constr.gridx = 0 constr.gridy = 1 constr.fill = GridBagConstraints.BOTH return constr
def __init__(self, callbacks): self._callbacks = callbacks self.tab = JPanel(GridBagLayout()) about_constraints = GridBagConstraints() about_author = (("<html><center><h2>SpyDir</h2><b>Version:</b> " "%s<br/>Created by: <em>Ryan Reid</em>" " (@_aur3lius)<br/>https://github.com/aur3lius-dev/" "SpyDir</center><br/>") % VERSION) about_spydir = """<em><center> SpyDir is an extension that assists in the enumeration of application<br/> endpoints via an input directory containing the application's<br/> source code. It provides an option to process files as endpoints,<br/> think: ASP, PHP, HTML, or parse files to attempt to enumerate<br/> endpoints via plugins, think: MVC. Users may opt to send the<br/> discovered endpoints directly to the Burp Spider. </center></em><br/> This tool is in <b>Alpha</b>! <b>Please</b> provide feedback on the GitHub page!<br/><br/>""" getting_started = """<b>Getting started:</b><br/> <ul> <li>Add a local source repository</li> <li>Add the target URL</li> <li>Use the String delimiter to construct the appropriate directory path (if necessary)</li> <li>Alternatively, parse each file by selecting plugins and checking the checkbox</li> <li>Explicitly define the file extensions to process</li> <li>Parse the directory</li> <li>Verify output is correct <b>before</b> sending to spider</li> <li>Send requests to the Burp Spider</li> </ul> """ advanced_info = r"""<html><b>String Delimiter</b><br/> String Delimiter allows us to append the necessary section of the folder structure.<br/> Suppose the target application is hosted at the following URL: https://localhost:8080. <br/>The target code base is stored in: 'C:\Source\TestApp'. <br/>Within the TestApp folder there is a subfolder, 'views', with static .html files.<br/> In this case the String Delimiter will need to equal 'TestApp'. <br/>With the expectation that the tool will produce an example URL will such as:<br/>https://localhost:8080/views/view1.html.<br/> <b>Note:</b> String Delimiter is ignored if parsing files using plugins! </html>""" about_constraints.anchor = GridBagConstraints.FIRST_LINE_START about_constraints.weightx = 1.0 about_constraints.weighty = 1.0 self.tab.add(JLabel("%s\n%s\n%s\n%s" % (about_author, about_spydir, getting_started, advanced_info)), about_constraints)
def addSigningKeyTextArea(self): self._signingKeyTextArea = JTextArea() self._signingKeyTextArea.setColumns(50) self._signingKeyTextArea.setRows(10) self._signingKeyScrollPane = JScrollPane(self._signingKeyTextArea) c = GridBagConstraints() c.gridx = 1 c.gridy = 6 c.anchor = GridBagConstraints.LINE_START self._configurationPanel.add(self._signingKeyScrollPane,c)
def __init__(self): self.running = True menuBar = JMenuBar() menu = JMenu("File") menu.add(OpenAction(self)) menu.add(CloseAction(self)) menu.addSeparator() menu.add(QuitAction(self)) self.addWindowListener(ProfelisWindowAdapter(self)) menuBar.add(menu) self.setJMenuBar(menuBar) self.contentPane = JPanel() self.contentPane.layout = GridBagLayout() constraints = GridBagConstraints() self.blastLocation = JTextField( System.getProperty("user.home") + "/blast") self.databaseLocation = JTextField( System.getProperty("user.home") + "/blast/db") self.projects = JTabbedPane() constraints.gridx, constraints.gridy = 0, 0 constraints.gridwidth, constraints.gridheight = 1, 1 constraints.fill = GridBagConstraints.NONE constraints.weightx, constraints.weighty = 0, 0 self.contentPane.add(JLabel("Blast Location"), constraints) constraints.gridx, constraints.gridy = 1, 0 constraints.fill = GridBagConstraints.HORIZONTAL constraints.weightx, constraints.weighty = 1, 0 self.contentPane.add(self.blastLocation, constraints) constraints.gridx, constraints.gridy = 2, 0 constraints.fill = GridBagConstraints.NONE constraints.weightx, constraints.weighty = 0, 0 self.contentPane.add(JButton(BlastAction(self)), constraints) constraints.gridx, constraints.gridy = 3, 0 constraints.fill = GridBagConstraints.NONE constraints.weightx, constraints.weighty = 0, 0 self.contentPane.add(JLabel("Database Location"), constraints) constraints.gridx, constraints.gridy = 4, 0 constraints.fill = GridBagConstraints.HORIZONTAL constraints.weightx, constraints.weighty = 1, 0 self.contentPane.add(self.databaseLocation, constraints) constraints.gridx, constraints.gridy = 5, 0 constraints.fill = GridBagConstraints.NONE constraints.weightx, constraints.weighty = 0, 0 self.contentPane.add(JButton(DatabaseAction(self)), constraints) constraints.gridx, constraints.gridy = 0, 1 constraints.gridwidth, constraints.gridheight = 6, 1 constraints.fill = GridBagConstraints.BOTH constraints.weightx, constraints.weighty = 1, 1 self.contentPane.add(self.projects, constraints)
def _new_grid_bag(gridx, gridy, gridwidth=1): """Creates a new GridBagConstraints""" g = GridBagConstraints() g.gridx = gridx g.gridy = gridy g.gridwidth = gridwidth g.fill = GridBagConstraints.BOTH g.insets = Insets(2, 2, 5, 5) return g
def _constructResultsPanel(self, insets): resultsPanel = JPanel(GridBagLayout()) self._progressBar = JProgressBar() self._progressBar.setStringPainted(True) self._progressBar.setMinimum(0) progressBarContraints = GridBagConstraints() progressBarContraints.gridx = 0 progressBarContraints.gridy = 0 progressBarContraints.fill = GridBagConstraints.HORIZONTAL resultsPanel.add(self._progressBar, progressBarContraints) self._resultsTableModel = ResultsTableModel(COLUMNS, 0) resultsTable = JTable(self._resultsTableModel) resultsTable.setAutoCreateRowSorter(True) cellRenderer = ColoredTableCellRenderer() for index in [5, 6, 7, 8, 9]: column = resultsTable.columnModel.getColumn(index) column.cellRenderer = cellRenderer resultsTable.getColumnModel().getColumn(0).setPreferredWidth(99999999) resultsTable.getColumnModel().getColumn(1).setMinWidth(160) resultsTable.getColumnModel().getColumn(2).setMinWidth(100) resultsTable.getColumnModel().getColumn(3).setMinWidth(80) resultsTable.getColumnModel().getColumn(4).setMinWidth(80) resultsTable.getColumnModel().getColumn(5).setMinWidth(110) resultsTable.getColumnModel().getColumn(6).setMinWidth(110) resultsTable.getColumnModel().getColumn(7).setMinWidth(90) resultsTable.getColumnModel().getColumn(8).setMinWidth(110) resultsTable.getColumnModel().getColumn(9).setMinWidth(110) resultsTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS) resultsScrollPane = JScrollPane(resultsTable) resultsScrollPaneConstraints = GridBagConstraints() resultsScrollPaneConstraints.gridx = 0 resultsScrollPaneConstraints.gridy = 1 resultsScrollPaneConstraints.weightx = 1 resultsScrollPaneConstraints.weighty = 1 resultsScrollPaneConstraints.fill = GridBagConstraints.BOTH resultsPanel.add(resultsScrollPane, resultsScrollPaneConstraints) return resultsPanel
def initComponents(self): self.setLayout(GridBagLayout()) gc = GridBagConstraints() gc.weightx = 1 gc.weighty = 1 # First Row gc.gridy = 0 gc.weightx = 1 gc.weighty = 0.1 gc.gridx = 0 gc.fill = GridBagConstraints.NONE gc.anchor = GridBagConstraints.LINE_END gc.insets = Insets(0, 0, 0, 5) self.add(self.usernameLabel, gc) gc.gridx = 1 gc.anchor = GridBagConstraints.LINE_START gc.insets = Insets(0, 0, 0, 0) self.add(self.usernameField, gc) # Second Row gc.gridy += 1 gc.weightx = 1 gc.weighty = 0.1 gc.gridx = 0 gc.anchor = GridBagConstraints.LINE_END gc.insets = Insets(0, 0, 0, 5) self.add(self.superPassLabel, gc) gc.gridx = 1 gc.anchor = GridBagConstraints.LINE_START gc.insets = Insets(0, 0, 0, 0) self.add(self.superPassField, gc) #Next Row gc.gridy += 1 gc.weightx = 1 gc.weighty = 2.0 gc.gridx = 1 gc.anchor = GridBagConstraints.FIRST_LINE_START self.add(self.deleteAdminBtn, gc) innerBorder = BorderFactory.createTitledBorder('Delete Admin') outerBorder = BorderFactory.createEmptyBorder(5, 5, 5, 5) self.setBorder( BorderFactory.createCompoundBorder(outerBorder, innerBorder))
def build_general_panel(self): ''' Create the panel that'll go in the General tab. This should contain options for choosing which server to use for validation as well as default working dir. ''' panel = JPanel(GridBagLayout()) constraints = GridBagConstraints() constraints.insets = Insets(10, 10, 10, 10) panel = self.build_working_dir_panel(constraints, panel) panel = self.build_servers_panel(constraints, panel) return panel
def __initTable(self): ''' construct the test case table ''' self.model = TestCaseModel(self.testcases) self.table = TestCaseTable(self.model, self.testcases) self.scrollpane = JScrollPane(self.table) self.setLayout(GridBagLayout()) self.constr = GridBagConstraints() self.constr.weighty = 1 self.constr.weightx = 1 self.constr.gridx = 0 self.constr.gridy = 1 self.constr.fill = GridBagConstraints.BOTH self.add(self.scrollpane,self.constr)
def __init__(self): self.setLayout(GridBagLayout()) shrinkX = JButton("shrinkX") shrinkX.actionPerformed = lambda event: rescaleLayout(0.5, 1) constr = GridBagConstraints() constr.gridx = 0 constr.gridy = 0 self.add(shrinkX, constr) growX = JButton("growX") growX.actionPerformed = lambda event: rescaleLayout(1.5, 1) constr = GridBagConstraints() constr.gridx = 2 constr.gridy = 0 self.add(growX, constr) shrinkY = JButton("shrinkY") shrinkY.actionPerformed = lambda event: rescaleLayout(1, 0.5) constr = GridBagConstraints() constr.gridx = 0 constr.gridy = 2 self.add(shrinkY, constr) growY = JButton("growY") growY.actionPerformed = lambda event: rescaleLayout(1, 1.5) constr = GridBagConstraints() constr.gridx = 2 constr.gridy = 2 self.add(growY, constr) centerB = JButton("center") centerB.actionPerformed = lambda event: center() constr = GridBagConstraints() constr.gridx = 1 constr.gridy = 1 self.add(centerB, constr) ui.dock(self)
def _constructAboutPanel(self, insets): aboutPanel = JPanel(GridBagLayout()) with open("about.html") as file: aboutBody = file.read() aboutLabel = JLabel(aboutBody.format(extension_name=EXTENSION_NAME)) aboutLabelConstraints = GridBagConstraints() aboutLabelConstraints.weightx = 1 aboutLabelConstraints.weighty = 1 aboutLabelConstraints.insets = insets aboutLabelConstraints.fill = GridBagConstraints.HORIZONTAL aboutLabelConstraints.anchor = GridBagConstraints.PAGE_START aboutPanel.add(aboutLabel, aboutLabelConstraints) return aboutPanel
def compose_ui(self, components): panel = JPanel() panel.setLayout(GridBagLayout()) constraints= GridBagConstraints() constraints.fill = GridBagConstraints.HORIZONTAL constraints.insets = Insets(2, 1, 2, 1) for i in components: for j in components[i]: constraints.gridy, constraints.gridx = i, j constraints.gridwidth = components[i][j]['width'] if type(components[i][j]) == dict and 'width' in components[i][j] else 1 constraints.gridheight = components[i][j]['height'] if type(components[i][j]) == dict and 'height' in components[i][j] else 1 item = components[i][j]['item'] if type(components[i][j]) == dict and 'item' in components[i][j] else components[i][j] panel.add(item, constraints) return panel
def build_appearance_panel(self): ''' Create the panel that'll go in the General tab. This should contain options for choosing which server to use for validation as well as default working dir. ''' panel = JPanel(GridBagLayout()) constraints = self.add_constraints(GridBagConstraints(), insets=Insets(10, 10, 10, 10)) self.build_console_font_panel(constraints, panel) self.build_console_font_color_panel(constraints, panel) self.build_console_background_color_panel(constraints, panel) self.build_edit_area_font_panel(constraints, panel) return panel
def initComponents(self): self.panel0 = JPanel() self.rbgPanel0 = ButtonGroup() self.gbPanel0 = GridBagLayout() self.gbcPanel0 = GridBagConstraints() self.panel0.setLayout(self.gbPanel0) self.Label_2 = JLabel( "List of File Extensions to Export, Comma Seperated no dots (.)") 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.fileExtension_TF = JTextField(30, focusLost=self.setFileExtension) self.fileExtension_TF.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.fileExtension_TF, self.gbcPanel0) self.panel0.add(self.fileExtension_TF) 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.add(self.panel0)
def initializeDisplay(self, queries, swing): """ queries: A list of the fasts files to be processed. swing: If true then updates about progress will be displayed in a swing window, otherwise they will be written to stdout. Initializes the interface for telling the user about progress in the pipeline. Queries is used to count the number of queries the pipeline will process and to size the swing display(if it is used) so that text isn't cutoff at the edge of the window. The swing display is setup if swing is true. """ self.numJobs = len(queries) if swing: self.frame = JFrame("Neofelis") self.frame.addWindowListener(PipelineWindowAdapter(self)) contentPane = JPanel(GridBagLayout()) self.frame.setContentPane(contentPane) self.globalLabel = JLabel(max(queries, key=len)) self.globalProgress = JProgressBar(0, self.numJobs) self.currentLabel = JLabel(max(self.messages, key=len)) self.currentProgress = JProgressBar(0, len(self.messages)) self.doneButton = JButton(DoneAction(self.frame)) self.doneButton.setEnabled(False) constraints = GridBagConstraints() constraints.gridx, constraints.gridy = 0, 0 constraints.gridwidth, constraints.gridheight = 1, 1 constraints.weightx = 1 constraints.fill = GridBagConstraints.HORIZONTAL contentPane.add(self.globalLabel, constraints) constraints.gridy = 1 contentPane.add(self.globalProgress, constraints) constraints.gridy = 2 contentPane.add(self.currentLabel, constraints) constraints.gridy = 3 contentPane.add(self.currentProgress, constraints) constraints.gridy = 4 constraints.weightx = 0 constraints.fill = GridBagConstraints.NONE constraints.anchor = GridBagConstraints.LINE_END contentPane.add(self.doneButton, constraints) self.frame.pack() self.frame.setResizable(False) self.globalLabel.setText(" ") self.currentLabel.setText(" ") self.frame.setLocationRelativeTo(None) self.frame.setVisible(True)
def __initTable(self): ''' Construct the smell information table and add it ''' self.model = SmellIdentiKitModel() self.table = SmellIdentiKitTable(self.model, self.metricDict) self.listener = SelectionListener(self.table) self.table.getSelectionModel().addListSelectionListener(self.listener) self.table.getColumnModel().getSelectionModel().addListSelectionListener(self.listener) self.scrollpane = JScrollPane(self.table) self.setLayout(GridBagLayout()) self.constr = GridBagConstraints() self.constr.fill = GridBagConstraints.BOTH self.constr.weighty = 1 self.constr.weightx = 1 self.constr.gridx = 0 self.constr.gridy = 1 self.add(self.scrollpane,self.constr)
def tagLoad(self): # 创建窗口 开始 self.tabs = JTabbedPane() self.scan_type_settings = JPanel(GridBagLayout()) c = GridBagConstraints() # 界面选项卡加载 self.tag_1(c) self.tag_2(c) # 添加选项卡 self.tabs.addTab(u'扫描类型设置', self.scan_type_settings) self._callbacks.customizeUiComponent(self.tabs) self._callbacks.addSuiteTab(self)