def __init__(self, scl_long_tuneup_controller): self.scl_long_tuneup_controller = scl_long_tuneup_controller self.setLayout(BorderLayout()) #----etched border etched_border = BorderFactory.createEtchedBorder() titled_border = BorderFactory.createTitledBorder( etched_border, "Init, Start, Stop Statistic Measurements") self.setBorder(titled_border) #----- buttons panel buttons_panel = JPanel(FlowLayout(FlowLayout.LEFT, 10, 3)) init_meter_button = JButton("Initialize Meter") init_meter_button.addActionListener( Init_Meter_Button_Listener(self.scl_long_tuneup_controller)) start_statistics_button = JButton("Start Statistic") start_statistics_button.addActionListener( Start_Statistics_Button_Listener(self.scl_long_tuneup_controller)) stop_statistics_button = JButton("Stop") stop_statistics_button.addActionListener( Stop_Statistics_Button_Listener(self.scl_long_tuneup_controller)) counter_lbl = JLabel(" Counter=", JLabel.RIGHT) self.counter_text = DoubleInputTextField(0., ScientificNumberFormat(1), 4) buffer_size_lbl = JLabel(" Buffer Size=", JLabel.RIGHT) self.buffer_size_text = DoubleInputTextField(10., ScientificNumberFormat(1), 4) self.fixInitEenergy_RadioButton = JRadioButton( "Keep Guess Energy (to get offsets)") self.fixInitEenergy_RadioButton.setSelected(false) buttons_panel.add(init_meter_button) buttons_panel.add(start_statistics_button) buttons_panel.add(stop_statistics_button) buttons_panel.add(counter_lbl) buttons_panel.add(self.counter_text) buttons_panel.add(self.fixInitEenergy_RadioButton) buttons_panel.add(buffer_size_lbl) buttons_panel.add(self.buffer_size_text) #----- energy panel energy_panel = JPanel(FlowLayout(FlowLayout.LEFT, 10, 3)) energy_guess_lbl = JLabel( "<html>Initial Guess E<SUB>kin</SUB>[MeV]=<html>", JLabel.RIGHT) self.energy_guess_text = DoubleInputTextField( 0., ScientificNumberFormat(7), 12) energy_lbl = JLabel("<html>Found E<SUB>kin</SUB>[MeV]=<html>", JLabel.RIGHT) self.energy_text = DoubleInputTextField(0., ScientificNumberFormat(7), 12) energy_err_lbl = JLabel("+-", JLabel.RIGHT) self.energy_err_text = DoubleInputTextField(0., ScientificNumberFormat(7), 12) energy_panel.add(energy_guess_lbl) energy_panel.add(self.energy_guess_text) energy_panel.add(energy_lbl) energy_panel.add(self.energy_text) energy_panel.add(energy_err_lbl) energy_panel.add(self.energy_err_text) #----- main panel self.add(buttons_panel, BorderLayout.NORTH) self.add(energy_panel, BorderLayout.CENTER)
def __init__(self,scl_long_tuneup_controller): self.scl_long_tuneup_controller = scl_long_tuneup_controller self.setLayout(FlowLayout(FlowLayout.LEFT,3,3)) #----etched border etched_border = BorderFactory.createEtchedBorder() self.setBorder(etched_border) #--- buttons sub_panel = JPanel(FlowLayout(FlowLayout.LEFT,3,3)) sub_panel.setBorder(etched_border) final_offsets_lbl = JLabel("Use the folowing Offsets as final= ",JLabel.LEFT) self.ccl4_button = JRadioButton("CCL4") self.hebt1_button = JRadioButton("HEBT1") self.ccl4_button.setSelected(true) self.hebt1_button.setSelected(false) self.final_select_button_group = ButtonGroup() self.final_select_button_group.add(self.ccl4_button) self.final_select_button_group.add(self.hebt1_button) self.ccl4_button.addActionListener(Set_as_Final_Button_Listener(self.scl_long_tuneup_controller)) self.hebt1_button.addActionListener(Set_as_Final_Button_Listener(self.scl_long_tuneup_controller)) sub_panel.add(final_offsets_lbl) sub_panel.add(self.ccl4_button) sub_panel.add(self.hebt1_button) set_bpms_as_bad_button = JButton("Mark Selected BPMs as Bad") set_bpms_as_bad_button.addActionListener(Set_BPms_as_Bad_Button_Listener(self.scl_long_tuneup_controller)) set_bpms_as_bad_lbl = JLabel("This will mark all selected BPMs as BAD! Irreversibly!",JLabel.LEFT) self.add(sub_panel) self.add(set_bpms_as_bad_button) self.add(set_bpms_as_bad_lbl)
def __init__(self,main_loop_controller): self.main_loop_controller = main_loop_controller self.setLayout(GridLayout(3,1,1,1)) self.setBorder(BorderFactory.createEtchedBorder()) start_button = JButton("Start") start_button.addActionListener(Start_Button_Listener(self.main_loop_controller)) start_selected_button = JButton("Start Selected Cavs.") start_selected_button.addActionListener(Start_Selected_Cavs_Button_Listener(self.main_loop_controller)) stop_button = JButton("Stop") stop_button.addActionListener(Stop_Button_Listener(self.main_loop_controller)) send_amp_phase_to_EPICS_button = JButton("Send New Amp&Phase to EPICS for Selected Cavs") send_amp_phase_to_EPICS_button.addActionListener(Send_Amp_Phase_to_EPICS_Button_Listener(self.main_loop_controller)) restore_amp_phase_to_EPICS_button = JButton("Restore Init Amp&Phase to EPICS for Selected Cavs") restore_amp_phase_to_EPICS_button.addActionListener(Restore_Amp_Phase_of_Selected_Cavs_to_EPICS_Button_Listener(self.main_loop_controller)) correct_phase_shifts_button = JButton("Correct Phase Shifts for 360 deg Scans") correct_phase_shifts_button.addActionListener(Correct_Phase_Shifts_for_360deg_Scans_Button_Listener(self.main_loop_controller)) self.keepAllCavParams_RadioButton = JRadioButton("Keep Cavs' Amps&Phases") self.keepAmps_RadioButton = JRadioButton("Keep Cavities' Amplitudes") self.status_text = JTextField(30) self.status_text.setForeground(Color.red) self.status_text.setText("Not running.") status_text_label = JLabel("Loop status:",JLabel.RIGHT) status_panel_tmp0 = JPanel(GridLayout(2,1,1,1)) status_panel_tmp0.add(status_text_label) status_panel_tmp0.add(self.main_loop_controller.main_loop_timer.time_estimate_label) status_panel_tmp1 = JPanel(GridLayout(2,1,1,1)) status_panel_tmp1.add(self.status_text) status_panel_tmp1.add(self.main_loop_controller.main_loop_timer.time_estimate_text) status_panel = JPanel(BorderLayout()) status_panel.add(status_panel_tmp0,BorderLayout.WEST) status_panel.add(status_panel_tmp1,BorderLayout.CENTER) status_panel.setBorder(BorderFactory.createEtchedBorder()) buttons_panel0 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) buttons_panel0.add(start_button) buttons_panel0.add(start_selected_button) buttons_panel0.add(stop_button) buttons_panel1 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) buttons_panel1.add(self.keepAllCavParams_RadioButton) buttons_panel1.add(self.keepAmps_RadioButton) buttons_panel = JPanel(GridLayout(2,1,1,1)) buttons_panel.add(buttons_panel0) buttons_panel.add(buttons_panel1) #--------------------------------------- bottom_buttons_panel0 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) bottom_buttons_panel0.add(send_amp_phase_to_EPICS_button) bottom_buttons_panel1 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) bottom_buttons_panel1.add(restore_amp_phase_to_EPICS_button) bottom_buttons_panel2 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) bottom_buttons_panel2.add(correct_phase_shifts_button) bottom_buttons_panel = JPanel(GridLayout(3,1,1,1)) bottom_buttons_panel.add(bottom_buttons_panel0) bottom_buttons_panel.add(bottom_buttons_panel1) bottom_buttons_panel.add(bottom_buttons_panel2) #--------------------------------------- self.add(buttons_panel) self.add(status_panel) self.add(bottom_buttons_panel)
def __init__(self,transverse_twiss_analysis_Controller): self.transverse_twiss_analysis_Controller = transverse_twiss_analysis_Controller self.setLayout(BorderLayout()) #-----------dict table panel etched_border = BorderFactory.createEtchedBorder() border = BorderFactory.createTitledBorder(etched_border,"Quad and Cavities Amp.&Phases Sets") self.setBorder(border) self.quad_cav_dict_table_model = QuadCavDict_Table_Model(self.transverse_twiss_analysis_Controller.accStatesKeeper) self.dict_table = JTable(self.quad_cav_dict_table_model) self.dict_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION) self.dict_table.setFillsViewportHeight(true) self.dict_table.setPreferredScrollableViewportSize(Dimension(120,100)) self.dict_table.getSelectionModel().addListSelectionListener(QuadCavDict_Table_Selection_Listener(self.transverse_twiss_analysis_Controller)) #--------buttons panel button_panel = JPanel(BorderLayout()) self.gaussButton = JRadioButton("Use Ext. Gauss Fit") self.custom_gaussButton = JRadioButton("Use Gauss Fit") self.custom_rmsButton = JRadioButton("Use RMS") button_group = ButtonGroup() button_group.add(self.gaussButton) button_group.add(self.custom_gaussButton) button_group.add(self.custom_rmsButton) button_group.clearSelection() self.gaussButton.setSelected(true) button_panel0 = JPanel(FlowLayout(FlowLayout.LEFT,2,2)) button_panel0.add(self.gaussButton) button_panel1 = JPanel(FlowLayout(FlowLayout.LEFT,2,2)) button_panel1.add(self.custom_gaussButton) button_panel2 = JPanel(FlowLayout(FlowLayout.LEFT,2,2)) button_panel2.add(self.custom_rmsButton) button_panel012 = JPanel(GridLayout(3,1)) button_panel012.add(button_panel0) button_panel012.add(button_panel1) button_panel012.add(button_panel2) #-------new buttons----- button_bottom_panel = JPanel(FlowLayout(FlowLayout.LEFT,2,2)) button_bottom_panel0 = JPanel(GridLayout(3,1,2,2)) dump_quad_fields_button = JButton("Dump Quad Fields to ASCII") dump_quad_fields_button.addActionListener(Dump_Quad_Fields_Button_Listener(self.transverse_twiss_analysis_Controller)) button_bottom_panel0.add(dump_quad_fields_button) dump_cav_amps_phases_button = JButton("Dump. Cav Amps. Phases to ASCII") dump_cav_amps_phases_button.addActionListener(Dump_Cav_Amps_Phases_Button_Listener(self.transverse_twiss_analysis_Controller)) button_bottom_panel0.add(dump_cav_amps_phases_button) read_cav_amps_phases_button = JButton("Read Cav Amps. Phases from ASCII") read_cav_amps_phases_button.addActionListener(Read_Cav_Amps_Phases_Button_Listener(self.transverse_twiss_analysis_Controller)) button_bottom_panel0.add(read_cav_amps_phases_button) button_bottom_panel.add(button_bottom_panel0) #----- final knobs panel button_panel.add(button_panel012,BorderLayout.NORTH) button_panel.add(button_bottom_panel,BorderLayout.SOUTH) self.gaussButton.addActionListener(FitParam_Buttons_Listener(self.transverse_twiss_analysis_Controller,0)) self.custom_gaussButton.addActionListener(FitParam_Buttons_Listener(self.transverse_twiss_analysis_Controller,1)) self.custom_rmsButton.addActionListener(FitParam_Buttons_Listener(self.transverse_twiss_analysis_Controller,2)) #---------------------------------------------------------- self.add(JScrollPane(self.dict_table), BorderLayout.WEST) self.add(button_panel, BorderLayout.CENTER)
def __init__(self,linac_wizard_document): #--- linac_wizard_document the parent document for all controllers self.linac_wizard_document = linac_wizard_document self.main_panel = JPanel(BorderLayout()) #----etched border etched_border = BorderFactory.createEtchedBorder() #------tables with Seq. names and button tables_panel = JPanel(BorderLayout()) tables_panel.setBorder(etched_border) self.first_table = JTable(WS_Records_Table_Model("First ")) self.last_table = JTable(WS_Records_Table_Model("Last ")) self.first_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION) self.last_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION) self.first_table.setFillsViewportHeight(true) self.last_table.setFillsViewportHeight(true) tables01_panel = JPanel(BorderLayout()) scrl_panel0 = JScrollPane(self.first_table) scrl_panel1 = JScrollPane(self.last_table) #tables01_panel.add(JScrollPane(self.first_table),BorderLayout.WEST) #tables01_panel.add(JScrollPane(self.last_table),BorderLayout.EAST) self.first_table.getCellRenderer(0,0).setHorizontalAlignment(JLabel.CENTER) self.last_table.getCellRenderer(0,0).setHorizontalAlignment(JLabel.CENTER) self.first_table.setPreferredScrollableViewportSize(Dimension(120,300)) self.last_table.setPreferredScrollableViewportSize(Dimension(120,300)) tables01_panel.add(scrl_panel0,BorderLayout.WEST) tables01_panel.add(scrl_panel1,BorderLayout.EAST) tables_button_panel = JPanel(BorderLayout()) tables_button_panel.add(tables01_panel,BorderLayout.WEST) seq_button_panel = JPanel(FlowLayout(FlowLayout.CENTER,5,5)) seq_set_button = JButton(" Set ComboSequence ") seq_button_panel.add(seq_set_button) tables_button_panel.add(seq_button_panel,BorderLayout.SOUTH) tables_panel.add(tables_button_panel,BorderLayout.NORTH) self.main_panel.add(tables_panel,BorderLayout.WEST) #--------central panel------- cav_amp_phase_button = JButton(" Read Cavities Amp.&Phases from Ext. File ") cav_info_from_scl_tuneup_button = JButton("Get SCL Cav. Amp.&Phases from SCL Long. TuneUp") new_accelerator_button = JButton(" Setup a New Accelerator File ") center_buttons_panel0 = JPanel(FlowLayout(FlowLayout.CENTER,5,5)) center_buttons_panel0.add(cav_amp_phase_button) center_buttons_panel1 = JPanel(FlowLayout(FlowLayout.CENTER,5,5)) center_buttons_panel1.add(cav_info_from_scl_tuneup_button) center_buttons_panel2 = JPanel(FlowLayout(FlowLayout.CENTER,5,5)) center_buttons_panel2.add(new_accelerator_button) center_buttons_panel = JPanel(GridLayout(3,1)) center_buttons_panel.add(center_buttons_panel0) center_buttons_panel.add(center_buttons_panel1) center_buttons_panel.add(center_buttons_panel2) center_panel = JPanel(BorderLayout()) center_panel.add(center_buttons_panel,BorderLayout.NORTH) self.main_panel.add(center_panel,BorderLayout.CENTER) #---------add actions listeners seq_set_button.addActionListener(Make_Sequence_Listener(self)) cav_amp_phase_button.addActionListener(Read_Cav_Amp_Phase_Dict_Listener(self)) cav_info_from_scl_tuneup_button.addActionListener(Get_SCL_Cav_Amp_Phase_Listener(self)) new_accelerator_button.addActionListener(SetUp_New_Accelerator_Listener(self))
def __init__(self,dtl_acceptance_scans_controller): self.dtl_acceptance_scans_controller = dtl_acceptance_scans_controller self.main_loop_controller = self.dtl_acceptance_scans_controller.main_loop_controller self.setLayout(GridLayout(3,1,1,1)) self.setBorder(BorderFactory.createEtchedBorder()) #----------------------------------------------------------- start_selected_button = JButton("Start Scan for Selected Cavs") start_selected_button.addActionListener(Start_Scan_Selected_Cavs_Button_Listener(self.dtl_acceptance_scans_controller)) stop_button = JButton("Stop") stop_button.addActionListener(Stop_Scan_Button_Listener(self.dtl_acceptance_scans_controller)) send_amp_phase_to_EPICS_button = JButton("Send New Amp&Phase to EPICS for Selected Cavs") send_amp_phase_to_EPICS_button.addActionListener(Send_Amp_Phase_to_EPICS_Button_Listener(self.dtl_acceptance_scans_controller)) restore_amp_phase_to_EPICS_button = JButton("Restore Init Amp&Phase to EPICS for Selected Cavs") restore_amp_phase_to_EPICS_button.addActionListener(Restore_Amp_Phase_of_Selected_Cavs_to_EPICS_Button_Listener(self.dtl_acceptance_scans_controller)) self.keepPhases_RadioButton = JRadioButton("Keep Cavities Phases") self.keepAmps_RadioButton = JRadioButton("Keep Cavities Amplitudes") self.skipAnalysis_RadioButton = JRadioButton("Skip Analysis") #----------------------------------------------------------- self.status_text = JTextField(30) self.status_text.setForeground(Color.red) self.status_text.setText("Not running.") status_text_label = JLabel("Loop status:",JLabel.RIGHT) status_panel_tmp0 = JPanel(GridLayout(2,1,1,1)) status_panel_tmp0.add(status_text_label) status_panel_tmp0.add(self.dtl_acceptance_scans_controller.acc_scan_loop_timer.time_estimate_label) status_panel_tmp1 = JPanel(GridLayout(2,1,1,1)) status_panel_tmp1.add(self.status_text) status_panel_tmp1.add(self.dtl_acceptance_scans_controller.acc_scan_loop_timer.time_estimate_text) status_panel = JPanel(BorderLayout()) status_panel.add(status_panel_tmp0,BorderLayout.WEST) status_panel.add(status_panel_tmp1,BorderLayout.CENTER) status_panel.setBorder(BorderFactory.createEtchedBorder()) #------------------------------------------------ buttons_panel0 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) buttons_panel0.add(start_selected_button) buttons_panel0.add(stop_button) buttons_panel1 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) buttons_panel1.add(self.skipAnalysis_RadioButton) buttons_panel1.add(self.keepPhases_RadioButton) buttons_panel1.add(self.keepAmps_RadioButton) buttons_panel = JPanel(GridLayout(2,1,1,1)) buttons_panel.add(buttons_panel0) buttons_panel.add(buttons_panel1) #--------------------------------------- bottom_buttons_panel0 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) bottom_buttons_panel0.add(send_amp_phase_to_EPICS_button) bottom_buttons_panel1 = JPanel(FlowLayout(FlowLayout.LEFT,3,1)) bottom_buttons_panel1.add(restore_amp_phase_to_EPICS_button) bottom_buttons_panel = JPanel(GridLayout(2,1,1,1)) bottom_buttons_panel.add(bottom_buttons_panel0) bottom_buttons_panel.add(bottom_buttons_panel1) #--------------------------------------- self.add(buttons_panel) self.add(status_panel) self.add(bottom_buttons_panel)
def __init__(self, rf_power_controller): self.rf_power_controller = rf_power_controller self.setLayout(GridLayout(3, 1, 1, 1)) self.setBorder(BorderFactory.createEtchedBorder()) start_button = JButton("Start Averaging") start_button.addActionListener( Start_Button_Listener(self.rf_power_controller)) stop_button = JButton("Stop") stop_button.addActionListener( Stop_Button_Listener(self.rf_power_controller)) n_avg_label = JLabel("N Avg.=", JLabel.RIGHT) self.n_avg_text = DoubleInputTextField(10.0, DecimalFormat("###.#"), 5) time_step_label = JLabel("Time Step[sec]=", JLabel.RIGHT) self.time_step_text = DoubleInputTextField(1.1, DecimalFormat("##.#"), 4) send_amp_phase_to_EPICS_button = JButton( "Send New Amp to Selected Cavs") send_amp_phase_to_EPICS_button.addActionListener( Send_Amp_Phase_to_EPICS_Button_Listener(self.rf_power_controller)) make_new_pwrs_as_target_button = JButton( "Make Measured Powers as New Traget for Selected Cavs") make_new_pwrs_as_target_button.addActionListener( Make_New_Pwrs_as_Target_Button_Listener(self.rf_power_controller)) self.status_text = JTextField(30) self.status_text.setForeground(Color.red) self.status_text.setText("Not running.") status_text_label = JLabel("Averaging status:", JLabel.RIGHT) status_panel = JPanel(BorderLayout()) status_panel.add(status_text_label, BorderLayout.WEST) status_panel.add(self.status_text, BorderLayout.CENTER) status_panel.setBorder(BorderFactory.createEtchedBorder()) buttons_panel = JPanel(FlowLayout(FlowLayout.LEFT, 3, 1)) buttons_panel.add(start_button) buttons_panel.add(stop_button) buttons_panel.add(n_avg_label) buttons_panel.add(self.n_avg_text) buttons_panel.add(time_step_label) buttons_panel.add(self.time_step_text) #--------------------------------------- bottom_buttons_panel = JPanel(FlowLayout(FlowLayout.LEFT, 1, 1)) bottom_buttons_panel_tmp = JPanel(GridLayout(2, 1, 1, 1)) bottom_buttons_panel_tmp0 = JPanel(FlowLayout(FlowLayout.LEFT, 1, 1)) bottom_buttons_panel_tmp1 = JPanel(FlowLayout(FlowLayout.LEFT, 1, 1)) bottom_buttons_panel_tmp.add(bottom_buttons_panel_tmp0) bottom_buttons_panel_tmp.add(bottom_buttons_panel_tmp1) bottom_buttons_panel.add(bottom_buttons_panel_tmp) bottom_buttons_panel_tmp0.add(send_amp_phase_to_EPICS_button) bottom_buttons_panel_tmp1.add(make_new_pwrs_as_target_button) #--------------------------------------- self.add(buttons_panel) self.add(status_panel) self.add(bottom_buttons_panel)
def __init__(self,top_document,accl): #--- top_document is a parent document for all controllers self.top_document = top_document self.main_loop_controller = self.top_document.main_loop_controller self.main_panel = JPanel(BorderLayout()) #----etched border etched_border = BorderFactory.createEtchedBorder() #--------------------------------------------- #---- Cavities' Controllers - only DTLs self.cav_acc_scan_controllers = [] self.cav_wrappers = self.main_loop_controller.cav_wrappers[4:10] self.cav_acc_scan_controllers.append(DTL_Acc_Scan_Cavity_Controller(self,self.cav_wrappers[0],"FC160")) self.cav_acc_scan_controllers.append(DTL_Acc_Scan_Cavity_Controller(self,self.cav_wrappers[1],"FC248")) self.cav_acc_scan_controllers.append(DTL_Acc_Scan_Cavity_Controller(self,self.cav_wrappers[2],"FC334")) self.cav_acc_scan_controllers.append(DTL_Acc_Scan_Cavity_Controller(self,self.cav_wrappers[3],"FC428")) self.cav_acc_scan_controllers.append(DTL_Acc_Scan_Cavity_Controller(self,self.cav_wrappers[4],"FC524")) self.cav_acc_scan_controllers.append(DTL_Acc_Scan_Cavity_Controller(self,self.cav_wrappers[5],"FC104")) #----acceptance scans loop timer self.acc_scan_loop_timer = Acc_Scan_Loop_Timer(self) #---------------------------------------------- self.tabbedPane = JTabbedPane() self.tabbedPane.add("Cavity",JPanel(BorderLayout())) self.tabbedPane.add("Pattern",JPanel(BorderLayout())) #-------------------------------------------------------- self.cav_table = JTable(Cavities_Table_Model(self)) self.cav_table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION) self.cav_table.setFillsViewportHeight(true) self.cav_table.setPreferredScrollableViewportSize(Dimension(500,120)) self.cav_table.getSelectionModel().addListSelectionListener(Cavs_Table_Selection_Listener(self)) scrl_cav_panel = JScrollPane(self.cav_table) #------------------------------------------------------- scrl_cav_panel.setBorder(BorderFactory.createTitledBorder(etched_border,"Cavities' Parameters")) init_buttons_panel = JPanel(FlowLayout(FlowLayout.LEFT,5,2)) #---- initialization buttons init_selected_cavs_button = JButton("Init Selected Cavs") init_selected_cavs_button.addActionListener(Init_Selected_Cavs_Button_Listener(self)) fc_in_selected_cavs_button = JButton("FC In for Selected Cavs") fc_in_selected_cavs_button.addActionListener(FC_In_Selected_Cavs_Button_Listener(self)) fc_out_selected_cavs_button = JButton("FC Out for Selected Cavs") fc_out_selected_cavs_button.addActionListener(FC_Out_Selected_Cavs_Button_Listener(self)) init_buttons_panel.add(init_selected_cavs_button) init_buttons_panel.add(fc_in_selected_cavs_button) init_buttons_panel.add(fc_out_selected_cavs_button) #---- start stop buttons panel self.start_stop_panel = Start_Stop_Panel(self) #------------------------------------------------- tmp0_panel = JPanel(BorderLayout()) tmp0_panel.add(init_buttons_panel,BorderLayout.NORTH) tmp0_panel.add(scrl_cav_panel,BorderLayout.CENTER) tmp0_panel.add(self.start_stop_panel,BorderLayout.SOUTH) tmp1_panel = JPanel(BorderLayout()) tmp1_panel.add(tmp0_panel,BorderLayout.NORTH) #------------------------------------------------- left_panel = JPanel(BorderLayout()) left_panel.add(tmp1_panel,BorderLayout.WEST) #-------------------------------------------------- self.main_panel.add(left_panel,BorderLayout.WEST) self.main_panel.add(self.tabbedPane,BorderLayout.CENTER) #----------- loop state self.loop_run_state = Acc_Scans_Loop_Run_State()
def __init__(self, scl_long_tuneup_controller): self.scl_long_tuneup_controller = scl_long_tuneup_controller self.setLayout(BorderLayout()) #----etched border etched_border = BorderFactory.createEtchedBorder() titled_border = BorderFactory.createTitledBorder( etched_border, "BPM Phase Offsets Manipulation") self.setBorder(titled_border) #----- buttons panel buttons_panel = JPanel(FlowLayout(FlowLayout.LEFT, 10, 3)) zero_offsets_button = JButton("Zero all Offsets") zero_offsets_button.addActionListener( Zero_Offsets_Button_Listener(self.scl_long_tuneup_controller)) correct_offsets_button = JButton("Correct Offsets with Phase Diff") correct_offsets_button.addActionListener( Correct_Offsets_Diff_Button_Listener( self.scl_long_tuneup_controller)) write_to_ascii_button = JButton("Write Offsets to ASCII") write_to_ascii_button.addActionListener( Write_To_ASCII_Button_Listener(self.scl_long_tuneup_controller)) read_from_ascii_button = JButton("Read Offsets from ASCII") read_from_ascii_button.addActionListener( Read_From_ASCII_Button_Listener(self.scl_long_tuneup_controller)) buttons_panel.add(zero_offsets_button) buttons_panel.add(correct_offsets_button) buttons_panel.add(write_to_ascii_button) buttons_panel.add(read_from_ascii_button) #----- main panel self.add(buttons_panel, BorderLayout.NORTH)
def registerExtenderCallbacks(self, callbacks): # keep a reference to our callbacks object self._callbacks = callbacks # obtain an extension helpers object self._helpers = callbacks.getHelpers() # define stdout writer self._stdout = PrintWriter(callbacks.getStdout(), True) self._stdout.println(self.EXTENSION_NAME + ' by @luxcupitor') self._stdout.println('================================') self._stdout.println('') self._stdout.println('TIP: Go to "Custom Scanner" tab and click "Execute on Proxy History"') self._stdout.println('to run the scanner checks on recently imported session files.') self._stdout.println('') # set our extension name callbacks.setExtensionName(self.EXTENSION_NAME) callbacks.registerScannerCheck(self) # add the custom tab and button to Burp's UI self._newpanel = Panel() self._newpanel.setLayout(FlowLayout()) self._button = JButton("Execute on Proxy History", actionPerformed=self.checkProxyHistory) self._newpanel.add(self._button) callbacks.customizeUiComponent(self._newpanel) callbacks.addSuiteTab(self) return
def complex_console(): global frame #generates frame frame = JFrame("[BETA] Game Master\'s Bot - Console Log") frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) frame.setResizable(False) frame.setAlwaysOnTop(True) frame.setBounds(8,545,600,130) frame.contentPane.layout = FlowLayout() #add QUIT button quitButton = JButton("QUIT", actionPerformed = closeFrame) quitButton.setForeground(Color.RED) quitButton.setPreferredSize(Dimension(100,100)) frame.contentPane.add(quitButton) #add text message global textArea textArea = JTextArea(6,38) textArea.setEditable(False) frame.contentPane.add(textArea) scrollPane = JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) frame.contentPane.add(scrollPane) #show frame frame.pack() frame.setVisible(True) log("Welcome to Game Master\'s Bot!")
def __init__(self, parent=None): JDialog.__init__(self, title="My dialog", modal=1) self.contentPane.layout = FlowLayout() self.contentPane.add(JLabel("A dialog!")) self.contentPane.add( JButton("OK", actionPerformed=lambda e, t=self: t.dispose())) self.pack()
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()
def run( self ) : frame = JFrame( 'Listen3', layout = FlowLayout(), locationRelativeTo = None, size = ( 512, 256 ), defaultCloseOperation = JFrame.EXIT_ON_CLOSE ) frame.add( JLabel( 'Input:', horizontalAlignment = SwingConstants.RIGHT ) ) self.text = frame.add( JTextField( 8 ) ) frame.add( JButton( 'Clear', actionPerformed = self.clear ) ) self.textArea = JTextArea( rows = 10, columns = 40 ) frame.add( JScrollPane( self.textArea ) ) self.text.addKeyListener( listener( self.textArea ) ) frame.setVisible( 1 )
def run(self): frame = JFrame('Spinner4', layout=FlowLayout(), defaultCloseOperation=JFrame.EXIT_ON_CLOSE) frame.add(JSpinner(SpinnerDateModel())) frame.pack() frame.setVisible(1)
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 run(self): frame = JFrame('Console timeout', defaultCloseOperation=JFrame.EXIT_ON_CLOSE) #----------------------------------------------------------------------- # The frame (i.e., it's ContentPane) should use a vertically aligned # BoxLayout layout manager (i.e., along the Y_AXIS) #----------------------------------------------------------------------- cp = frame.getContentPane() cp.setLayout(BoxLayout(cp, BoxLayout.Y_AXIS)) #----------------------------------------------------------------------- # The JTextField will be preceeded, and followed by JLabel components # identifying the value being displayed, and the associated time units. # However, we want them displayed horizontally, so we put them into a # single JPanel instance using a FlowLayout layout manager #----------------------------------------------------------------------- input = JPanel(layout=FlowLayout()) input.add(JLabel('Timeout:')) self.text = JTextField(3, actionPerformed=self.update) input.add(self.text) self.text.setText(getTimeout()) input.add(JLabel('minutes')) cp.add(input) #----------------------------------------------------------------------- # Then, we add a message area beneath #----------------------------------------------------------------------- self.msg = cp.add(JLabel()) frame.setSize(290, 100) frame.setVisible(1)
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)
def buildpane(self): gw = JPanel(GridLayout(1, 2), doublebuffered) gw.add(JLabel("Gateway")) self.gwlist = JComboBox( self.gateways.keys()) #, actionPerformed=self.changegw) self.gwlist.setSelectedItem("Twisted") gw.add(self.gwlist) stdoptions = JPanel(GridLayout(2, 2), doublebuffered) stdoptions.border = TitledBorder("Standard Options") stdoptions.add(JLabel()) stdoptions.add(self.autologin) stdoptions.add(JLabel("Account Name")) stdoptions.add(self.acctname) buttons = JPanel(FlowLayout(), doublebuffered) buttons.add(JButton("OK", actionPerformed=self.addaccount)) buttons.add(JButton("Cancel", actionPerformed=self.cancel)) mainpane = self.mainframe.getContentPane() mainpane.layout = BoxLayout(mainpane, BoxLayout.Y_AXIS) mainpane.add(gw) mainpane.add(self.gwoptions) mainpane.add(stdoptions) mainpane.add(buttons)
def initial(): global f ##文件 global txt global number_of_occurrence reload(sys) sys.setdefaultencoding('utf-8') ctr.init() ctr.set_value('flag', 0) ctr.set_value('reload_check', 0) ctr.set_value('world_boss_check', 0) ctr.set_value('raid_check', 0) #ctr.set_value('raid_check',None) number_of_occurrence = 0 ctr.set_value('max_level_check', None) ctr.set_value('return_check', 0) ticks = time.time() date = time.strftime("%Y_%m_%d_%H_%M_%S", time.localtime(ticks)) + '_日誌' f = open(date + '.txt', 'w', 0) frame = JFrame("Log") txt = JTextArea(19, 55) scrollPane = JScrollPane(txt) ##frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) frame.setLocation(2000, 100) frame.setSize(480, 450) frame.setLayout(FlowLayout()) ##label = JLabel('記錄:') scrollPane.setHorizontalScrollBarPolicy( JScrollPane.HORIZONTAL_SCROLLBAR_NEVER) ##frame.add(label) frame.add(scrollPane) frame.setVisible(True)
def run(self): frame = JFrame('FlowLayout', defaultCloseOperation=JFrame.EXIT_ON_CLOSE) cp = frame.getContentPane() #----------------------------------------------------------------------- # The alignment can be one of the following values: #----------------------------------------------------------------------- # cp.setLayout( FlowLayout( FlowLayout.LEFT ) ) # cp.setLayout( FlowLayout( FlowLayout.RIGHT ) ) cp.setLayout(FlowLayout()) # FlowLayout.CENTER is the default value # cp.setLayout( FlowLayout( FlowLayout.LEADING ) ) # cp.setLayout( FlowLayout( FlowLayout.TRAILING ) ) for name in '1,two,Now is the time...'.split(','): frame.add(JButton(name)) #----------------------------------------------------------------------- # The ComponentOrientation can be one of the following values # Note: The default value is related to the system locale #----------------------------------------------------------------------- # cp.setComponentOrientation( ComponentOrientation.LEFT_TO_RIGHT ) # cp.setComponentOrientation( ComponentOrientation.RIGHT_TO_LEFT ) frame.setSize(350, 100) frame.setVisible(1)
def top_panel(self): title = swing.JLabel(self._info['title'][0],swing.JLabel.LEFT) title.setFont(Font("Arial", Font.BOLD, 24)) title.setForeground(self._burpColor) self.compartment = swing.JPanel() self.compartment.add(title) self.compartment.setLayout(FlowLayout(FlowLayout.LEFT)) self.compartment.setMaximumSize(Dimension(Short.MAX_VALUE, 40))
def run(self): frame = JFrame('Spinner1', layout=FlowLayout(), defaultCloseOperation=JFrame.EXIT_ON_CLOSE) daysOfWeek = [dow for dow in DFS().getWeekdays() if dow] frame.add(JSpinner(SpinnerListModel(daysOfWeek))) frame.pack() frame.setVisible(1)
def _create_ui(self, employees): panel = JPanel(layout=FlowLayout()) self._overview = EmployeeOverview(employees, self) self._details = EmployeeDetails(employees) self._welcome = Welcome() panel.add(self._overview) panel.add(self._welcome) return panel
def init_ui(self): self.setTitle("QDisc Edit Profile") self.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) self.setLocation(250, 100) self.setSize(1024, 400) # self.setExtendedState(JFrame.MAXIMIZED_BOTH) main_panel = JPanel() main_panel.setLayout(BorderLayout()) self.setContentPane(main_panel) # Build the config dialog first, so it can be attached to the Edit button config_dialog = JPanel() config_dialog.setLayout(BorderLayout()) self.build_panels(config_dialog) def show_config_dialog(event): result = JOptionPane.showConfirmDialog( self, config_dialog, "Edit Profile", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) if result == 0: print "Will save results" top_panel = JPanel() top_panel.setLayout(FlowLayout(FlowLayout.LEADING)) title_lbl = JLabel("TODO Set title") title_lbl.setFont(ui_components.get_title_font(title_lbl)) top_panel.add(title_lbl) main_panel.add(top_panel, BorderLayout.PAGE_START) self.profile_table = self.initProfilesTable() scrollPane = JScrollPane(self.profile_table) main_panel.add(scrollPane, BorderLayout.CENTER) # self.profile_list.setCellRenderer(ui_components.FilterRenderer()) buttons_panel = JPanel() buttons_panel.setLayout(FlowLayout(FlowLayout.LEADING)) main_panel.add(buttons_panel, BorderLayout.PAGE_END) edit_profile_btn = JButton("Edit", actionPerformed=show_config_dialog) buttons_panel.add(edit_profile_btn) # status_panel = self.build_status_panel(b) # main_panel.add(status_panel, BorderLayout.PAGE_END) self.setVisible(True)
def __init__(self): super(BeautifierPanel, self).__init__() self.setLayout(BorderLayout()) self.beautifyTextArea = JTextArea(5, 10) self.beautifyTextArea.setLineWrap(True) self.beautifyTextArea.setDocument(self.CustomUndoPlainDocument()) # The undo doesn't work well before replace text. Below is rough fix, so not need to know how undo work for now self.beautifyTextArea.setText(" ") self.beautifyTextArea.setText("") self.undoManager = UndoManager() self.beautifyTextArea.getDocument().addUndoableEditListener( self.undoManager) self.beautifyTextArea.getDocument().addDocumentListener( self.BeautifyDocumentListener(self)) beautifyTextWrapper = JPanel(BorderLayout()) beautifyScrollPane = JScrollPane(self.beautifyTextArea) beautifyTextWrapper.add(beautifyScrollPane, BorderLayout.CENTER) self.add(beautifyTextWrapper, BorderLayout.CENTER) self.beautifyButton = JButton("Beautify") self.beautifyButton.addActionListener(self.beautifyListener) self.undoButton = JButton("Undo") self.undoButton.addActionListener(self.undoListener) formatLabel = JLabel("Format:") self.formatsComboBox = JComboBox() for f in supportedFormats: self.formatsComboBox.addItem(f) self.statusLabel = JLabel("Status: Ready") preferredDimension = self.statusLabel.getPreferredSize() self.statusLabel.setPreferredSize( Dimension(preferredDimension.width + 20, preferredDimension.height)) self.sizeLabel = JLabel("0 B") preferredDimension = self.sizeLabel.getPreferredSize() self.sizeLabel.setPreferredSize( Dimension(preferredDimension.width + 64, preferredDimension.height)) self.sizeLabel.setHorizontalAlignment(SwingConstants.RIGHT) buttonsPanel = JPanel(FlowLayout()) buttonsPanel.add(formatLabel) buttonsPanel.add(self.formatsComboBox) buttonsPanel.add(Box.createHorizontalStrut(10)) buttonsPanel.add(self.beautifyButton) buttonsPanel.add(self.undoButton) bottomPanel = JPanel(BorderLayout()) bottomPanel.add(self.statusLabel, BorderLayout.WEST) bottomPanel.add(buttonsPanel, BorderLayout.CENTER) bottomPanel.add(self.sizeLabel, BorderLayout.EAST) self.add(bottomPanel, BorderLayout.SOUTH) self.currentBeautifyThread = None
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() #h = self.lblGroupPreferredSize.getHeight() #w = self.lblGroupPreferredSize.getWidth() #self.lblGroupPreferredSize.setSize(h, w) self.pnlLayer = JPanel() self.pnlLayer.setOpaque(False) self.pnlLayer.setLayout(FlowLayout(FlowLayout.LEFT)) self.lblClean = JLabel() self.chkLayerVisibility = JCheckBox() self.chkLayerVisibility.setOpaque(False) self.lblLayerName = JLabel() self.lblLayerIcon = JLabel() self.lblFeatureSelecteds = JLabel() self.pnlLayer.add(self.chkLayerVisibility) self.pnlLayer.add(self.lblClean) self.pnlLayer.add(self.lblFeatureSelecteds) self.pnlLayer.add(self.lblLayerIcon) self.pnlLayer.add(self.lblLayerName) self.tree.setRowHeight( int(self.pnlLayer.getPreferredSize().getHeight()) - 3) self.lblUnknown = JLabel() ## Feature self.lblFeatureIcon = JLabel() self.lblFeatureName = JLabel() i18n = ToolsLocator.getI18nManager() self.lblFeatureName.setText(i18n.getTranslation("_Feature")) self.pnlFeature = JPanel() self.pnlFeature.setOpaque(False) self.pnlFeature.setLayout(FlowLayout(FlowLayout.LEFT)) self.pnlFeature.add(self.lblFeatureIcon) self.pnlFeature.add(self.lblFeatureName)
def build_buttons_panel(self): ''' Builds the buttons panel to save or cancel changes. TODO: Reset button to reset to defaults? ''' panel = JPanel(FlowLayout()) panel.add(JButton('Cancel', actionPerformed=self.cancel)) panel.add(JButton('Save', actionPerformed=self.save)) return panel
def __init__(self,scl_long_tuneup_controller): self.scl_long_tuneup_controller = scl_long_tuneup_controller self.setLayout(BorderLayout()) #----etched border etched_border = BorderFactory.createEtchedBorder() titled_border = BorderFactory.createTitledBorder(etched_border,"SetUp Cavities' New Design Amplitudes and Phases") self.setBorder(titled_border) #--- buttons------------ init_model_button = JButton("Init SCL Model") init_model_button.addActionListener(Init_Tracking_Model_Listener(self.scl_long_tuneup_controller)) read_epics_button = JButton("<html>Get New Live A<SUB>EPICS</SUB><html>") read_epics_button.addActionListener(Read_From_EPICS_Listener(self.scl_long_tuneup_controller)) copy_old_button = JButton("Restore Synch. Phases") copy_old_button.addActionListener(Copy_Old_to_New_Listener(self.scl_long_tuneup_controller)) change_selected_lbl = JLabel("<html>Change Selected New Δφ<SUB>Synch</SUB>(deg)<html>",JLabel.RIGHT) self.avg_gap_phase_wheel = Wheelswitch() self.avg_gap_phase_wheel.setFormat("+###.#") self.avg_gap_phase_wheel.setValue(0.) self.avg_gap_phase_wheel.addPropertyChangeListener("value", Wheel_Listener(self.scl_long_tuneup_controller)) self.is_wheel_listen = true #---- buttons panel buttons_panel = JPanel(FlowLayout(FlowLayout.LEFT,10,3)) buttons_panel.add(init_model_button) buttons_panel.add(read_epics_button) buttons_panel.add(copy_old_button) #---- wheel panle wheel_panel = JPanel(FlowLayout(FlowLayout.LEFT,10,3)) wheel_panel.add(change_selected_lbl) wheel_panel.add(self.avg_gap_phase_wheel) #---- the energy panel energy_panel = JPanel(FlowLayout(FlowLayout.LEFT,10,3)) energy_calc_button = JButton("<html>Calculate E<SUB>kin</SUB><html>") energy_calc_button.addActionListener(Calculate_Energy_Listener(self.scl_long_tuneup_controller)) energy_lbl = JLabel("<html>SCL Final E<SUB>kin</SUB>[MeV]=<html>",JLabel.RIGHT) self.energy_text = DoubleInputTextField(0.,DecimalFormat("####.#####"),12) energy_panel.add(energy_calc_button) energy_panel.add(energy_lbl) energy_panel.add(self.energy_text) #---- add to the main subpanel self.add(buttons_panel,BorderLayout.NORTH) self.add(energy_panel,BorderLayout.CENTER) self.add(wheel_panel,BorderLayout.SOUTH) #---- this is a holder for RF_Gap_Phases_Holder_for_Table_Selection self.rf_gap_phases_holder = null
def createButtonPane(self): """Create a new button pane for the message editor tab""" self._button_listener = EditorButtonListener(self) panel = JPanel() panel.setLayout(BoxLayout(panel, BoxLayout.Y_AXIS)) panel.setBorder(EmptyBorder(5, 5, 5, 5)) panel.add(Box.createRigidArea(Dimension(0, 5))) type_scroll_pane = JScrollPane(self._type_list_component) type_scroll_pane.setMaximumSize(Dimension(200, 100)) type_scroll_pane.setMinimumSize(Dimension(150, 100)) panel.add(type_scroll_pane) panel.add(Box.createRigidArea(Dimension(0, 3))) new_type_panel = JPanel() new_type_panel.setLayout(BoxLayout(new_type_panel, BoxLayout.X_AXIS)) new_type_panel.add(self._new_type_field) new_type_panel.add(Box.createRigidArea(Dimension(3, 0))) new_type_panel.add( self.createButton( "New", "new-type", "Save this message's type under a new name" ) ) new_type_panel.setMaximumSize(Dimension(200, 20)) new_type_panel.setMinimumSize(Dimension(150, 20)) panel.add(new_type_panel) button_panel = JPanel() button_panel.setLayout(FlowLayout()) if self._editable: button_panel.add( self.createButton( "Validate", "validate", "Validate the message can be encoded." ) ) button_panel.add( self.createButton("Edit Type", "edit-type", "Edit the message type") ) button_panel.add( self.createButton( "Reset Message", "reset", "Reset the message and undo changes" ) ) button_panel.add( self.createButton( "Clear Type", "clear-type", "Reparse the message with an empty type" ) ) button_panel.setMinimumSize(Dimension(100, 200)) button_panel.setPreferredSize(Dimension(200, 1000)) panel.add(button_panel) return panel