当前位置: 首页>>代码示例>>Python>>正文


Python JTable.setFillsViewportHeight方法代码示例

本文整理汇总了Python中javax.swing.JTable.setFillsViewportHeight方法的典型用法代码示例。如果您正苦于以下问题:Python JTable.setFillsViewportHeight方法的具体用法?Python JTable.setFillsViewportHeight怎么用?Python JTable.setFillsViewportHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTable的用法示例。


在下文中一共展示了JTable.setFillsViewportHeight方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class QuadCavDictSelection_Panel	(JPanel):
	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 getMainPanel(self):
		return self
开发者ID:kritha,项目名称:MyOpenXal,代码行数:62,代码来源:transverse_twiss_analysis_cntrl_lib.py

示例2: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class SCL_Long_TuneUp_PhaseScan_Controller:
	def __init__(self,scl_long_tuneup_controller):
		#--- scl_long_tuneup_controller the parent document for all SCL tune up controllers
		self.scl_long_tuneup_controller = 	scl_long_tuneup_controller	
		self.main_panel = JPanel(BorderLayout())
		#----etched border
		etched_border = BorderFactory.createEtchedBorder()			
		#------top params panel-----------------------
		top_params_panel = JPanel(BorderLayout())
		self.set_phase_shift_panel = SetPhaseShiftAndTimeStep_Panel(self.scl_long_tuneup_controller)
		self.start_stop_scan_panel = StartStopPhaseScan_Panel(self.scl_long_tuneup_controller)
		top_params_panel.add(self.set_phase_shift_panel,BorderLayout.NORTH)
		top_params_panel.add(self.start_stop_scan_panel,BorderLayout.SOUTH)
		#------cavities scan table panel --------
		cavs_scan_panel = JPanel(BorderLayout())
		self.cavs_table = JTable(Cavs_PhaseScan_Table_Model(self.scl_long_tuneup_controller))
		self.cavs_table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION)
		self.cavs_table.setFillsViewportHeight(true)
		self.cavs_table.getSelectionModel().addListSelectionListener(Cavs_Table_Selection_Listener(self.scl_long_tuneup_controller))		
		self.bpms_table_model = PhaseScan_BPMs_Table_Model(self.scl_long_tuneup_controller)
		self.bpms_table = JTable(self.bpms_table_model)
		self.bpms_table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION)
		self.bpms_table.setFillsViewportHeight(true)	
		self.bpms_table.getSelectionModel().addListSelectionListener(BPMs_Table_Selection_Listener(self.scl_long_tuneup_controller))	
		self.bpms_table.setPreferredScrollableViewportSize(Dimension(200,300))
		scrl_panel0 = JScrollPane(self.cavs_table)
		scrl_panel0.setBorder(etched_border)
		scrl_panel1 = JScrollPane(self.bpms_table)
		self.bpm_table_border = BorderFactory.createTitledBorder(etched_border,"Cavity")
		scrl_panel1.setBorder(self.bpm_table_border)
		cavs_scan_panel.add(scrl_panel0,BorderLayout.CENTER)
		cavs_scan_panel.add(scrl_panel1,BorderLayout.EAST)
		self.bpm_table_panel = scrl_panel1
		#---------- graph panels --------------------------
		self.bpm_phaseDiff_graph_panel = BPM_PhaseDiff_Graph_Panel(self.scl_long_tuneup_controller)
		self.bpm_phase_and_amp_graph_panel = BPMs_Amp_Phase_Graphs_Panel(self.scl_long_tuneup_controller)
		grap_panel = JPanel(GridLayout(1,2))
		grap_panel.add(self.bpm_phaseDiff_graph_panel)		
		grap_panel.add(self.bpm_phase_and_amp_graph_panel)
		#--------center panel = graphs + tables-------------
		center_panel = JPanel(GridLayout(2,1))
		center_panel.add(cavs_scan_panel)
		center_panel.add(grap_panel)
		#-------- post-scan filtering panel
		bottom_panel = JPanel(BorderLayout())
		self.post_scan_panel = PostPhaseScanActions_Panel(self.scl_long_tuneup_controller)
		bottom_panel.add(self.post_scan_panel,BorderLayout.WEST)
		#--------------------------------------------------
		self.main_panel.add(top_params_panel,BorderLayout.NORTH)
		self.main_panel.add(bottom_panel,BorderLayout.SOUTH)
		self.main_panel.add(center_panel,BorderLayout.CENTER)
		#------scan state
		self.scan_state_controller = ScanStateController()
		
	def getMainPanel(self):
		return self.main_panel
开发者ID:kritha,项目名称:MyOpenXal,代码行数:58,代码来源:scl_long_tuneup_phase_scan_cntrl_lib.py

示例3: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class SCL_Long_TuneUp_BPM_Offsets_Controller:
	def __init__(self,scl_long_tuneup_controller):
		#--- scl_long_tuneup_controller the parent document for all SCL tune up controllers
		self.scl_long_tuneup_controller = 	scl_long_tuneup_controller	
		self.main_panel = JPanel(BorderLayout())
		#----etched border
		etched_border = BorderFactory.createEtchedBorder()			
		#------top panels = offsets analysis ----------------------------
		top_panel = JPanel(BorderLayout())
		self.bpms_offsets_from_ccl4_panel = BPMs_Offsets_from_CCL4_Panel(self.scl_long_tuneup_controller)
		self.bpms_offsets_from_hebt1_panel = BPMs_Offsets_from_HEBT1_Panel(self.scl_long_tuneup_controller)
		self.bpms_offsets_from_ext_file_panel = BPMs_Offsets_from_ExtFile_Panel(self.scl_long_tuneup_controller)
		top_panel0 = JPanel(BorderLayout())
		top_panel0.add(self.bpms_offsets_from_ccl4_panel,BorderLayout.NORTH)
		top_panel0.add(self.bpms_offsets_from_hebt1_panel,BorderLayout.SOUTH)
		top_panel1 = JPanel(BorderLayout())
		top_panel1.add(top_panel0,BorderLayout.NORTH)
		top_panel1.add(self.bpms_offsets_from_ext_file_panel,BorderLayout.SOUTH)
		top_panel.add(top_panel1,BorderLayout.NORTH)
		#--------center panel = table------------
		center_panel = JPanel(BorderLayout())		
		self.bpm_offsets_table_model = PhaseOffsets_BPMs_Table_Model(self.scl_long_tuneup_controller)
		self.bpm_offsets_table = JTable(self.bpm_offsets_table_model)
		self.bpm_offsets_table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION)
		self.bpm_offsets_table.setFillsViewportHeight(true)	
		scrl_panel = JScrollPane(self.bpm_offsets_table)
		scrl_panel.setBorder(etched_border)
		center_panel.add(scrl_panel,BorderLayout.CENTER)
		#-------- bottom panel = post analysis ---------------
		bottom_panel = JPanel(BorderLayout())
		self.set_bpms_as_bad_panel = Set_BPMs_as_Bad_Panel(self.scl_long_tuneup_controller)
		bottom_panel.add(self.set_bpms_as_bad_panel,BorderLayout.SOUTH)
		#--------------------------------------------------
		self.main_panel.add(top_panel,BorderLayout.NORTH)
		self.main_panel.add(center_panel,BorderLayout.CENTER)
		self.main_panel.add(bottom_panel,BorderLayout.SOUTH)		
		
	def getMainPanel(self):
		return self.main_panel
		
	def setFinalOffsets(self):
		ccl4_button = self.set_bpms_as_bad_panel.ccl4_button
		ccl4_final = ccl4_button.isSelected()
		bpm_wrappers = self.scl_long_tuneup_controller.bpm_wrappers
		for bpm_wrapper in bpm_wrappers:
			if(bpm_wrapper.isGood):
				if(ccl4_final):
					bpm_wrapper.final_phase_offset.phaseOffset_avg = bpm_wrapper.left_phase_offset.phaseOffset_avg
					bpm_wrapper.final_phase_offset.phaseOffset_err = bpm_wrapper.left_phase_offset.phaseOffset_err
					bpm_wrapper.final_phase_offset.isReady = bpm_wrapper.left_phase_offset.isReady 
				else:
					bpm_wrapper.final_phase_offset.phaseOffset_avg = bpm_wrapper.right_phase_offset.phaseOffset_avg
					bpm_wrapper.final_phase_offset.phaseOffset_err = bpm_wrapper.right_phase_offset.phaseOffset_err		
					bpm_wrapper.final_phase_offset.isReady = bpm_wrapper.right_phase_offset.isReady 
		self.bpm_offsets_table.getModel().fireTableDataChanged()
开发者ID:kritha,项目名称:MyOpenXal,代码行数:57,代码来源:scl_long_tuneup_bpm_offsets_cntrl_lib.py

示例4: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class SCL_Long_TuneUp_Rescale_Controller:
	def __init__(self,scl_long_tuneup_controller):
		#--- scl_long_tuneup_controller the parent document for all SCL tune up controllers
		self.scl_long_tuneup_controller = 	scl_long_tuneup_controller	
		self.main_panel = JPanel(BorderLayout())
		#----etched border
		etched_border = BorderFactory.createEtchedBorder()			
		#------top params panel-----------------------
		top_panel = JPanel(BorderLayout())
		self.bpms_phase_shift_panel = BPMs_Phase_Shift_Panel(self.scl_long_tuneup_controller)
		self.init_amp_phases_panel = Init_New_Amps_Phases_Panel(self.scl_long_tuneup_controller)
		self.new_amp_phases_to_epics_panel = NEW_Amp_and_Phases_to_EPICS_Panel(self.scl_long_tuneup_controller)
		top_panel.add(self.bpms_phase_shift_panel,BorderLayout.NORTH)
		top_panel.add(self.init_amp_phases_panel,BorderLayout.CENTER)
		top_panel.add(self.new_amp_phases_to_epics_panel,BorderLayout.SOUTH)
		#------cavities table panel --------
		cavs_rescale_panel = JPanel(BorderLayout())
		txt = "Cavities' Prameters. New Amp and Avg. Gap Phases can be changed manually."
		rescale_table_border = BorderFactory.createTitledBorder(etched_border,txt)
		cavs_rescale_panel.setBorder(rescale_table_border)		
		self.cavs_rescale_table = JTable(Cavs_Rescale_Table_Model(self.scl_long_tuneup_controller))
		self.cavs_rescale_table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION)
		self.cavs_rescale_table.setFillsViewportHeight(true)
		self.cavs_rescale_table.getSelectionModel().addListSelectionListener(Cavs_Table_Selection_Listener(self.scl_long_tuneup_controller))		
		scrl_panel0 = JScrollPane(self.cavs_rescale_table)			
		cavs_rescale_panel.add(scrl_panel0,BorderLayout.CENTER)
		center_panel = JPanel(BorderLayout())
		center_panel.add(cavs_rescale_panel,BorderLayout.CENTER)
		#-------- post-rescale actions panel
		bottom_panel = JPanel(BorderLayout())
		#bottom_panel.add(self.post_rescale_panel,BorderLayout.WEST)
		#--------------------------------------------------
		self.main_panel.add(top_panel,BorderLayout.NORTH)
		self.main_panel.add(center_panel,BorderLayout.CENTER)
		self.main_panel.add(bottom_panel,BorderLayout.SOUTH)
		#----- model for tracking 	
		self.scl_tracker_model = SCL_RfGaps_Fitter_Tracker_Model(self.scl_long_tuneup_controller)
		
	def getMainPanel(self):
		return self.main_panel
		
	def updateTables(self):
		self.cavs_rescale_table.getModel().fireTableDataChanged()
开发者ID:kritha,项目名称:MyOpenXal,代码行数:45,代码来源:scl_long_tuneup_rescale_cntrl_lib.py

示例5: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class SCL_Long_TuneUp_PhaseAnalysis_Controller:
	def __init__(self,scl_long_tuneup_controller):
		#--- scl_long_tuneup_controller the parent document for all SCL tune up controllers
		self.scl_long_tuneup_controller = 	scl_long_tuneup_controller	
		self.main_panel = JPanel(BorderLayout())
		#----etched border
		etched_border = BorderFactory.createEtchedBorder()			
		#------top params panel-----------------------
		top_params_panel = JPanel(BorderLayout())
		self.start_stop_analysis_panel = StartStopPhaseAnalysis_Panel(self.scl_long_tuneup_controller)
		top_params_panel.add(self.start_stop_analysis_panel,BorderLayout.NORTH)
		#------cavities scan table panel --------
		cavs_scan_panel = JPanel(BorderLayout())
		self.cavs_table = JTable(Cavs_PhaseAnalysis_Table_Model(self.scl_long_tuneup_controller))
		self.cavs_table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION)
		self.cavs_table.setFillsViewportHeight(true)
		self.cavs_table.getSelectionModel().addListSelectionListener(Cavs_Table_Selection_Listener(self.scl_long_tuneup_controller))		
		scrl_panel0 = JScrollPane(self.cavs_table)
		scrl_panel0.setBorder(etched_border)
		cavs_scan_panel.add(scrl_panel0,BorderLayout.CENTER)
		#---------- graph panels --------------------------
		self.cav_energy_out_graph_panel = Cav_Energy_Out_Graph_Panel(self.scl_long_tuneup_controller)
		graph_panel = JPanel(GridLayout(1,1))
		graph_panel.add(self.cav_energy_out_graph_panel)
		#--------center panel = graphs + tables-------------
		center_panel = JPanel(GridLayout(2,1))
		center_panel.add(cavs_scan_panel)
		center_panel.add(graph_panel)
		#-------- post-scan filtering panel
		bottom_panel = JPanel(BorderLayout())
		self.post_analysis_panel = PostPhaseAnalysisActions_Panel(self.scl_long_tuneup_controller)
		bottom_panel.add(self.post_analysis_panel,BorderLayout.WEST)
		#--------------------------------------------------
		self.main_panel.add(top_params_panel,BorderLayout.NORTH)
		self.main_panel.add(bottom_panel,BorderLayout.SOUTH)
		self.main_panel.add(center_panel,BorderLayout.CENTER)
		#------scan state
		self.analysis_state_controller = AnalysisStateController()
		self.scl_one_cavity_tracker_model = SCL_One_Cavity_Tracker_Model(scl_long_tuneup_controller)
		
	def getMainPanel(self):
		return self.main_panel
开发者ID:kritha,项目名称:MyOpenXal,代码行数:44,代码来源:scl_long_tuneup_phase_analysis_cntrl_lib.py

示例6: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class RF_NET_Power_Controller:
	def __init__(self,top_document,main_loop_controller):
		#--- top_document is a parent document for all controllers
		self.top_document = top_document		
		self.main_loop_controller = main_loop_controller
		self.main_panel = JPanel(BorderLayout())
		#----etched border
		etched_border = BorderFactory.createEtchedBorder()
		#----------------------------------------------
		left_panel = JPanel(BorderLayout())
		self.rf_power_table = JTable(RF_Power_Table_Model(self))
		self.rf_power_table.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION)
		self.rf_power_table.setFillsViewportHeight(true)
		self.rf_power_table.setPreferredScrollableViewportSize(Dimension(800,240))
		scrl_rf_power_panel = JScrollPane(self.rf_power_table)
		scrl_rf_power_panel.setBorder(BorderFactory.createTitledBorder(etched_border,"RF Net Power"))
		self.init_buttons_panel = Init_RF_Power_Controller_Panel(self)
		self.start_stop_panel = Start_Stop_Panel(self)
		tmp0_panel = JPanel(BorderLayout())
		tmp0_panel.add(self.init_buttons_panel,BorderLayout.NORTH)
		tmp0_panel.add(scrl_rf_power_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.add(tmp1_panel,BorderLayout.WEST)
		#--------------------------------------------------------
		self.main_panel.add(left_panel,BorderLayout.WEST)
		#---- non GUI controllers
		self.loop_run_state = Loop_Run_State()
		
	def getMainPanel(self):
		return self.main_panel
		
	def getMessageTextField(self):
		return self.top_document.getMessageTextField()	
		
	def writeDataToXML(self,root_da):
		rf_power_cntrl_da = root_da.createChild("RF_NET_POWER")			
			
	def readDataFromXML(self,root_da):		
		rf_power_cntrl_da = root_da.childAdaptor("MAIN_CONTROLLER")
开发者ID:kritha,项目名称:MyOpenXal,代码行数:43,代码来源:rf_net_power_cotroller_lib.py

示例7: Quad_and_Cav_Params_Table_Panel

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class Quad_and_Cav_Params_Table_Panel(JPanel):
	def __init__(self,transverse_twiss_analysis_Controller):
		self.transverse_twiss_analysis_Controller = transverse_twiss_analysis_Controller
		self.setLayout(GridLayout(1,2))
		#----etched border
		etched_border = BorderFactory.createEtchedBorder()
		self.setBorder(etched_border)
		#--------- quad and cavities params tables
		self.quad_fields_table_model = Quad_Fileds_Table_Model(transverse_twiss_analysis_Controller)
		self.quad_fields_table = JTable(self.quad_fields_table_model)
		self.quad_fields_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
		self.quad_fields_table.setFillsViewportHeight(true)	
		quad_table_panel = JPanel(BorderLayout())
		quad_table_panel.add(JScrollPane(self.quad_fields_table), BorderLayout.CENTER)		
		self.cav_amp_phases_table_model = Cav_Amp_Phases_Table_Model(transverse_twiss_analysis_Controller)
		self.cav_amp_phases_table = JTable(self.cav_amp_phases_table_model)
		self.cav_amp_phases_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
		self.cav_amp_phases_table.setFillsViewportHeight(true)	
		cav_table_panel = JPanel(BorderLayout())
		cav_table_panel.add(JScrollPane(self.cav_amp_phases_table), BorderLayout.CENTER)
		#---------------------------------------
		self.add(quad_table_panel)
		self.add(cav_table_panel)
开发者ID:kritha,项目名称:MyOpenXal,代码行数:25,代码来源:transverse_twiss_analysis_cntrl_lib.py

示例8: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class Transverse_Twiss_Fitting_Controller:
	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()
		#-------------------------------------------------------------		
		self.initial_twiss_params_holder = Twiss_Params_Holder()
		self.initTwiss_table = JTable(Init_Twiss_Table_Model(self.initial_twiss_params_holder))
		self.initTwiss_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
		self.initTwiss_table.setFillsViewportHeight(true)
		self.initTwiss_table.setPreferredScrollableViewportSize(Dimension(240,160))
		initTwiss_panel = JPanel(BorderLayout())
		initTwiss_panel.add(JScrollPane(self.initTwiss_table), BorderLayout.CENTER)
		initTwiss_knobs_panel = JPanel(FlowLayout(FlowLayout.CENTER,5,5))
		initTwiss_button = JButton("Init Twiss from Design")
		initTwiss_button.addActionListener(Init_Twiss_Button_Listener(self))
		initTwiss_knobs_panel.add(initTwiss_button)
		initTwiss_panel.add(initTwiss_knobs_panel, BorderLayout.SOUTH)
		border = BorderFactory.createTitledBorder(etched_border,"Initial Twiss Parameters")
		initTwiss_panel.setBorder(border)			
		#--------Init_and_Fit_Params_Controller panel ----------
		self.init_and_fit_params_controller = Init_and_Fit_Params_Controller(self.linac_wizard_document,self)
		#Twiss fitter is defined in the transverse_twiss_fitter_lib.py 
		self.twiss_fitter = null
		#----add panels to the main
		tmp_panel = JPanel(BorderLayout())
		tmp_panel.add(initTwiss_panel, BorderLayout.WEST)
		tmp_panel.add(self.init_and_fit_params_controller.getMainPanel(),BorderLayout.EAST)
		self.main_panel.add(tmp_panel, BorderLayout.WEST)
		
	def getMainPanel(self):
		return self.main_panel		
开发者ID:kritha,项目名称:MyOpenXal,代码行数:38,代码来源:transverse_twiss_analysis_subpanel_cntrl_lib.py

示例9: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]

#.........这里部分代码省略.........
		self.cav_controllers[8].cav_bpms_controller.pasta_bpm_1_index = 6
		self.cav_controllers[9].cav_bpms_controller.pasta_bpm_0_index = 3
		self.cav_controllers[9].cav_bpms_controller.pasta_bpm_1_index = 5
		self.cav_controllers[10].cav_bpms_controller.pasta_bpm_0_index = 5
		self.cav_controllers[10].cav_bpms_controller.pasta_bpm_1_index = 6
		self.cav_controllers[11].cav_bpms_controller.pasta_bpm_0_index = 2
		self.cav_controllers[11].cav_bpms_controller.pasta_bpm_1_index = 3
		self.cav_controllers[12].cav_bpms_controller.pasta_bpm_0_index = 2
		self.cav_controllers[12].cav_bpms_controller.pasta_bpm_1_index = 4
		self.cav_controllers[13].cav_bpms_controller.pasta_bpm_0_index = 3
		self.cav_controllers[13].cav_bpms_controller.pasta_bpm_1_index = 4
		self.cav_controllers[11].cav_bpms_controller.sin_wave_bpm_index = 0
		self.cav_controllers[12].cav_bpms_controller.sin_wave_bpm_index = 0
		self.cav_controllers[13].cav_bpms_controller.sin_wave_bpm_index = 1
		#-----Target power levels
		self.cav_controllers[4].cav_wrapper.net_pwr_goal =  378.0
		self.cav_controllers[5].cav_wrapper.net_pwr_goal = 1208.0
		self.cav_controllers[6].cav_wrapper.net_pwr_goal = 1294.0
		self.cav_controllers[7].cav_wrapper.net_pwr_goal = 1416.0
		self.cav_controllers[8].cav_wrapper.net_pwr_goal = 1454.0
		self.cav_controllers[9].cav_wrapper.net_pwr_goal = 1414.0
		self.cav_controllers[10].cav_wrapper.net_pwr_goal = 2531.0
		self.cav_controllers[11].cav_wrapper.net_pwr_goal = 2984.0
		self.cav_controllers[12].cav_wrapper.net_pwr_goal = 3018.0
		self.cav_controllers[13].cav_wrapper.net_pwr_goal = 2856.0
		#----------------------------------------------   
		left_panel = JPanel(BorderLayout())
		self.tabbedPane = JTabbedPane()		
		self.tabbedPane.add("Cavity",JPanel(BorderLayout()))	
		self.tabbedPane.add("Parameters",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,240))
		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 = Init_Cav_Controllers_Panel(self)
		start_stop_panel = Start_Stop_Panel(self)
		#---- fake scan button
		self.keepAllCavParams_RadioButton = start_stop_panel.keepAllCavParams_RadioButton
		self.keepAmps_RadioButton = start_stop_panel.keepAmps_RadioButton
		#---- status text field
		self.status_text = start_stop_panel.status_text
		tmp0_panel = JPanel(BorderLayout())
		tmp0_panel.add(init_buttons_panel,BorderLayout.NORTH)
		tmp0_panel.add(scrl_cav_panel,BorderLayout.CENTER)
		tmp0_panel.add(start_stop_panel,BorderLayout.SOUTH)
		tmp1_panel = JPanel(BorderLayout())
		tmp1_panel.add(tmp0_panel,BorderLayout.NORTH)
		left_panel.add(tmp1_panel,BorderLayout.WEST)
		#--------------------------------------------------------
		self.main_panel.add(left_panel,BorderLayout.WEST)
		self.main_panel.add(self.tabbedPane,BorderLayout.CENTER)
		#---- non GUI controllers
		self.particle_tracker_model = Particle_Tracker_Model(self)
		self.env_tracker_model = Envelop_Tracker_Model(self)
		
	def getMainPanel(self):
		return self.main_panel
		
	def getMessageTextField(self):
		return self.top_document.getMessageTextField()
		
	def writeDataToXML(self,root_da):
开发者ID:kritha,项目名称:MyOpenXal,代码行数:70,代码来源:main_loop_controller_lib.py

示例10: SelPanel

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]

#.........这里部分代码省略.........
        falses = []
        pys = []
        for i in range(len(pv)):
            p = self.getP(pv[i])
            py = 1-2*abs(p-0.5)
            pys.append(py)
            #if p > ci or p<1-ci:
            #    pys.append(py)
        pys.append(0.0)
        pys.sort()
        rate = []
        maxRank=0
        for i in range(len(pys)):
            if pys[i]<=fdr*i/len(pys):
                maxRank = i
        #print maxRank
        falseReports = []
        for pvLine in pv:
            p = self.getP(pvLine)
            py = 1-2*abs(p-0.5)
            if py in pys:
                if pys.index(py)<=maxRank:
                    falseReports.append("Outlier")
                else:
                    falseReports.append("--")
            else:
                falseReports.append("NA")


        return falseReports

    def initTable(self, lociNames, pv, ci, locusFst):
        colNames = Vector()
        colNames.add('Locus')
        colNames.add('Het')
        colNames.add('Fst')
        colNames.add('P(simulated Fst < sample Fst)')
        colNames.add('FDR')
        data = Vector()
        self.data = data
        falses = self.calcFalsePositives(pv, ci, self.fdr)
        currentPos = 0
        for i in range(len(lociNames)):
            line = Vector()
            locus = lociNames[i]
            line.add(locus)
            if not locusFst[i]:
                line.add("NA")
                line.add("NA")
                line.add("NA")
                line.add("NA")
            else:
                line.add(str(pv[currentPos][0]))
                line.add(str(pv[currentPos][1]))
                line.add(str(self.getP(pv[currentPos])))
                line.add(str(falses[currentPos]))
                currentPos += 1
            data.add(line)
        self.table = JTable(data, colNames)
        self.table.setDefaultRenderer(Class.forName("java.lang.Object"),
               ColorRenderer(data, ci, self.chart.neuColor,
                   self.chart.balColor, self.chart.posColor))

    def __init__(self, frame, chart, lociNames, pv,
                 ci, confLines, locusFst, isDominant, fdr):
        JDialog(frame)
        self.chart = chart
        self.frame = frame
        self.confLines = confLines
        self.isDominant = isDominant
        self.fdr = fdr
        pane = self.getRootPane().getContentPane()

        pane.setLayout(BorderLayout())

        self.initTable(lociNames, pv, ci, locusFst)
        scrollPane = JScrollPane(self.table)
        osName = System.getProperty('os.name').lower()

        if not System.getProperty('java.specification.version')[-1] == '5':
            self.table.setFillsViewportHeight(True)
        pane.add(scrollPane, BorderLayout.CENTER)

        buttonPane = JPanel()
        sll = JButton('Save loci list')
        sll.addActionListener(self)
        sll.setActionCommand('SLL')
        buttonPane.add(sll)
        sci = JButton('Save confidence intervals')
        sci.addActionListener(self)
        sci.setActionCommand('SCI')
        buttonPane.add(sci)
        close = JButton('Close')
        close.addActionListener(self)
        close.setActionCommand('Close')
        buttonPane.add(close)
        pane.add(buttonPane, BorderLayout.PAGE_END)


        self.pack()
开发者ID:samitha,项目名称:lositan,代码行数:104,代码来源:SelPanel.py

示例11: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class WS_LW_Acquisition_Controller:
	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(GridLayout(2,1))
		self.quadFieldDict = {}
		self.cavAmpPhaseDict = {}
		self.quads = []
		self.cavs = []
		self.ws_table_model = WS_Table_Model()
		#----make LW or WS nodes
		self.ws_nodes = []
		#----etched border
		etched_border = BorderFactory.createEtchedBorder()
		#---make the WS_JTable + H&V Graphs Panels
		self.ws_table = JTable(self.ws_table_model)
		self.ws_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
		self.ws_table.setFillsViewportHeight(true)	
		ws_panel = JPanel(BorderLayout())
		ws_panel.add(JScrollPane(self.ws_table), BorderLayout.CENTER)
		ws_knobs_panel = JPanel(FlowLayout(FlowLayout.CENTER,5,5))
		ws_panel.add(ws_knobs_panel, BorderLayout.SOUTH)
		ws_panel.setBorder(etched_border)
		#---ws knobs ---------------------------------------------
		get_ws_data_button = JButton("Get WS/LW Data")
		switch_hv_button = JButton(" Switch H/V  ")	
		add_data_to_pool_button = JButton("  Add Data to Pool  ")
		ws_knobs_panel.add(get_ws_data_button)
		ws_knobs_panel.add(switch_hv_button)
		ws_knobs_panel.add(add_data_to_pool_button)
		get_ws_data_button.addActionListener(WS_GET_Data_Listener(self))
		switch_hv_button.addActionListener(Switch_HV_Listener(self))
		add_data_to_pool_button.addActionListener(WS_Data_to_Pool_Listener(self))
		#---------------------------------------------------------
		ws_and_graphs_panel = JPanel(BorderLayout())
		border = BorderFactory.createTitledBorder(etched_border,"WS/LW Raw Data Acquisition")
		ws_and_graphs_panel.setBorder(border)
		ws_and_graphs_panel.add(ws_panel, BorderLayout.WEST)
		graphs_panel = JPanel(GridLayout(1,2))
		self.gpanel_horWF = FunctionGraphsJPanel()
		self.gpanel_verWF = FunctionGraphsJPanel()
		self.gpanel_horWF.setLegendButtonVisible(true)
		self.gpanel_horWF.setChooseModeButtonVisible(true)			
		self.gpanel_verWF.setLegendButtonVisible(true)
		self.gpanel_verWF.setChooseModeButtonVisible(true)			
		self.gpanel_horWF.setName("Horizontal Profiles")
		self.gpanel_horWF.setAxisNames("pos, [mm]","Amp, [arb. units]")	
		self.gpanel_verWF.setName("Vertical Profiles")
		self.gpanel_verWF.setAxisNames("pos, [mm]","Amp, [arb. units]")	
		self.gpanel_horWF.setBorder(etched_border)
		self.gpanel_verWF.setBorder(etched_border)
		graphs_panel.add(self.gpanel_horWF)
		graphs_panel.add(self.gpanel_verWF)
		ws_and_graphs_panel.add(graphs_panel, BorderLayout.CENTER)
		self.setDataToGraphPanels(-1)
		#------analysis sub-panel
		self.ws_data_analysis_controller = WS_Data_Analysis_Controller(self)
		#---put everything into the main_panel
		self.main_panel.add(ws_and_graphs_panel)
		self.main_panel.add(self.ws_data_analysis_controller.main_panel)
		#---set up Listeners 
		self.ws_table.getSelectionModel().addListSelectionListener(WS_Table_Selection_Listener(self))	
		
	def setAccSeq(self,accSeq):
		self.ws_table_model.ws_table_element_arr = []
		self.ws_nodes = []
		if(accSeq == null): 
			self.ws_table_model.fireTableDataChanged()
			return
		nodes = accSeq.filterNodesByStatus(accSeq.getAllNodesOfType(ProfileMonitor.s_strType),true)
		for node in nodes:
			self.ws_nodes.append(node)
		nodes = accSeq.filterNodesByStatus(accSeq.getAllNodesOfType(Marker.s_strType),true)
		for node in nodes:
			if(node.getId().find("LW") >= 0 and node.getId().find("SCL") >= 0):
				self.ws_nodes.append(node)
		for node in self.ws_nodes:
			self.ws_table_model.addWS_TableElement(WS_Table_Element(node))	
		self.makePVforWS()
		#ws_table_elements_arr = self.ws_table_model.getWS_TableElements()
		#for ws_table_element in ws_table_elements_arr:	
		#	ws_table_element.readPVData()
		#----update data and graphs
		self.ws_table_model.fireTableDataChanged()
		self.setDataToGraphPanels(-1)
		#------------set up the quad and cavities dictionaries
		self.quadFieldDict = {}
		self.quads = accSeq.getAllNodesWithQualifier(AndTypeQualifier().and((OrTypeQualifier()).or(Quadrupole.s_strType)))
		for quad in self.quads:
			self.quadFieldDict[quad] = quad.getDfltField()
			"""
			if(quad.isPermanent()):
				self.quadFieldDict[quad] = quad.getDfltField()
			else:
				self.quadFieldDict[quad] = quad.getFieldReadback()
			"""
		self.cavAmpPhaseDict = {}
		rf_gaps = accSeq.getAllNodesWithQualifier(AndTypeQualifier().and((OrTypeQualifier()).or(RfGap.s_strType)))	
		self.cavs = []
		for rf_gap in rf_gaps:
#.........这里部分代码省略.........
开发者ID:kritha,项目名称:MyOpenXal,代码行数:103,代码来源:ws_lw_acquisition_cntrl_lib.py

示例12: QatDialog

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class QatDialog(ToggleDialog):
    """ToggleDialog for error type selection and buttons for reviewing
       errors in sequence
    """
    def __init__(self, name, iconName, tooltip, shortcut, height, app):
        ToggleDialog.__init__(self, name, iconName, tooltip, shortcut, height)
        self.app = app
        tools = app.tools

        #Main panel of the dialog
        mainPnl = JPanel(BorderLayout())
        mainPnl.setBorder(BorderFactory.createEmptyBorder(0, 1, 1, 1))

### First tab: errors selection and download ###########################
        #ComboBox with tools names
        self.toolsComboModel = DefaultComboBoxModel()
        for tool in tools:
            self.add_data_to_models(tool)
        self.toolsCombo = JComboBox(self.toolsComboModel,
                                    actionListener=ToolsComboListener(app))
        renderer = ToolsComboRenderer(self.app)
        renderer.setPreferredSize(Dimension(20, 20))
        self.toolsCombo.setRenderer(renderer)
        self.toolsCombo.setToolTipText(app.strings.getString("Select_a_quality_assurance_tool"))

        #ComboBox with categories names ("views"), of the selected tool
        self.viewsCombo = JComboBox(actionListener=ViewsComboListener(app))
        self.viewsCombo.setToolTipText(app.strings.getString("Select_a_category_of_error"))

        #Popup for checks table
        self.checkPopup = JPopupMenu()
        #add favourite check
        self.menuItemAdd = JMenuItem(self.app.strings.getString("Add_to_favourites"))
        self.menuItemAdd.setIcon(ImageIcon(File.separator.join([self.app.SCRIPTDIR,
                                                                "tools",
                                                                "data",
                                                                "Favourites",
                                                                "icons",
                                                                "tool_16.png"])))
        self.menuItemAdd.addActionListener(PopupActionListener(self.app))
        self.checkPopup.add(self.menuItemAdd)
        #remove favourite check
        self.menuItemRemove = JMenuItem(self.app.strings.getString("Remove_from_favourites"))
        self.menuItemRemove.setIcon(ImageIcon(File.separator.join([self.app.SCRIPTDIR,
                                                                   "tools",
                                                                   "data",
                                                                   "Favourites",
                                                                   "icons",
                                                                   "black_tool_16.png"])))
        self.menuItemRemove.addActionListener(PopupActionListener(self.app))
        self.checkPopup.add(self.menuItemRemove)
        #Help link for selected check
        self.menuItemHelp = JMenuItem(self.app.strings.getString("check_help"))
        self.menuItemHelp.setIcon(ImageIcon(File.separator.join([self.app.SCRIPTDIR,
                                                                 "images",
                                                                 "icons",
                                                                 "info_16.png"])))
        self.checkPopup.add(self.menuItemHelp)
        self.menuItemHelp.addActionListener(PopupActionListener(self.app))

        #Table with checks of selected tool and view
        self.checksTable = JTable()
        self.iconrenderer = IconRenderer()
        self.iconrenderer.setHorizontalAlignment(JLabel.CENTER)
        scrollPane = JScrollPane(self.checksTable)
        self.checksTable.setFillsViewportHeight(True)

        tableSelectionModel = self.checksTable.getSelectionModel()
        tableSelectionModel.addListSelectionListener(ChecksTableListener(app))

        self.checksTable.addMouseListener(ChecksTableClickListener(app,
            self.checkPopup,
            self.checksTable))

        #Favourite area status indicator
        self.favAreaIndicator = JLabel()
        self.update_favourite_zone_indicator()
        self.favAreaIndicator.addMouseListener(FavAreaIndicatorListener(app))

        #label with OSM id of the object currently edited and number of
        #errors still to review
        self.checksTextFld = JTextField("",
                                        editable=0,
                                        border=None,
                                        background=None)

        #checks buttons
        btnsIconsDir = File.separator.join([app.SCRIPTDIR, "images", "icons"])
        downloadIcon = ImageIcon(File.separator.join([btnsIconsDir, "download.png"]))
        self.downloadBtn = JButton(downloadIcon,
                                   actionPerformed=app.on_downloadBtn_clicked,
                                   enabled=0)
        startIcon = ImageIcon(File.separator.join([btnsIconsDir, "start_fixing.png"]))
        self.startBtn = JButton(startIcon,
                                actionPerformed=app.on_startBtn_clicked,
                                enabled=0)
        self.downloadBtn.setToolTipText(app.strings.getString("Download_errors_in_this_area"))
        self.startBtn.setToolTipText(app.strings.getString("Start_fixing_the_selected_errors"))

        #tab layout
#.........这里部分代码省略.........
开发者ID:floscher,项目名称:qat_script,代码行数:103,代码来源:QatDialog.py

示例13: SessionRequestTab

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]

#.........这里部分代码省略.........
                action = str(table_model.getValueAt(r, 1))
                name = table_model.getValueAt(r, 2)
                value = table_model.getValueAt(r, 3)

                if type != None and name != None and value != None:
                    param = Parameter(type, action, name, self._extender.helpers.urlDecode(value))
                    session.modify(param)


            # Check if there is an empty last row 
            has_empty_row = True
            for i in range(2, 4):
                val = table_model.getValueAt(table_model.getRowCount() - 1, i)
                if val != None and val != "":
                    has_empty_row = False
                    break

            # no empty last row, add one
            if not has_empty_row:
                table_model.addRow(["", Parameter.ACTION_MODIFY, "", ""])

            # update message editor
            self.parse_message()

    def parse_message(self):
        self._editor.setText(self._extender.process_request(self._extender.HTTP))

    def getTabCaption(self):
        return "Session"

    def getUiComponent(self):
        return self._panel

    def isEnabled(self, content, isRequest):
        return isRequest 

    def setMessage(self, content, isRequest):
        self._extender.HTTP = self._extender.helpers.bytesToString(content)
        self._editor.setText(content)
        self.refresh_sessions()
        self.update_table()


    def getMessage(self):
        return self._editor.getText()

    def isModified(self):
        return self._editor.isTextModified()

    def getSelectedData(self):
        return self._editor.getSelectedText()

    @attach_stack_trace
    def __init__(self, extender, controller, editable):
        self._extender = extender

        self._panel = JPanel()  # main panel

        # type combobox for tables
        self._types = Parameter.type_mapping.values() + ["- Remove Row -"]
        self._actions = ["replace", "insert", "delete"]

        # define the GridBagLayout ( 4x4 )
        gridBagLayout = GridBagLayout()
        gridBagLayout.columnWidths = [ 0, 0, 0, 0]
        gridBagLayout.rowHeights = [0, 0, 0, 0]
        gridBagLayout.columnWeights = [1.0, 0.0, 0.0, 0.0]
        gridBagLayout.rowWeights = [0.0, 1.0, 5.0, 0.0]
        self._panel.setLayout(gridBagLayout)

        # JComboBox for Session selection
        self._session_selector = JComboBox(extender.sm.sessions, itemStateChanged=self.changeSession)
        self._session_selector_model = self._session_selector.getModel()
        gbc_session_selector = _new_grid_bag(0, 0)
        self._panel.add(self._session_selector, gbc_session_selector)


        # "Delete Session" Button
        del_session = JButton("Delete Session", actionPerformed=self.deleteSession)
        gbc_del_session = _new_grid_bag(1, 0)
        self._panel.add(del_session, gbc_del_session)

        # "New Session" Button
        new_session = JButton("New Session", actionPerformed=self.new_session)
        gbc_new_session = _new_grid_bag(2, 0)
        self._panel.add(new_session, gbc_new_session)

        # Table containing modified parameters
        self.modification_table = JTable()
        self.update_table()

        gbc_modification_table = _new_grid_bag(0, 1, 3)
        self._panel.add(JScrollPane(self.modification_table), gbc_modification_table)
        self.modification_table.setPreferredScrollableViewportSize(self.modification_table.getPreferredSize());
        self.modification_table.setFillsViewportHeight(True)

        # HTTP message editor
        self._editor = self._extender.callbacks.createTextEditor()
        gbc_messageEditor = _new_grid_bag(0, 2, 3)
        self._panel.add(self._editor.getComponent(), gbc_messageEditor)
开发者ID:eboda,项目名称:burp-sessions,代码行数:104,代码来源:ui.py

示例14: __init__

# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setFillsViewportHeight [as 别名]
class LINAC_SetUp_Controller:
	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 getMainPanel(self):
		return self.main_panel
		
	def setSelectedSequences(self,first_seq_name,last_seq_name):
		index0 = self.first_table.getModel().accSeqName_arr.index(first_seq_name)
		index1 = self.last_table.getModel().accSeqName_arr.index(last_seq_name)
		self.first_table.setRowSelectionInterval(index0,index0)
		self.last_table.setRowSelectionInterval(index1,index1)
		
	def getSelectedSequencesNames(self):
		first_table = self.first_table
		index0 = first_table.getSelectedRow()
		last_table = self.last_table
		index1 = last_table.getSelectedRow()
		if(index0 < 0 or index1 < 0): return []
		seq_names = []
		if(index0 == index1):
			seq_names.append(first_table.getModel().accSeqName_arr[index0])
		else:
			if(index1 < index0):
				(index0,index1) = (index1,index0)
			for i in range(index0,index1+1):
				seq_names.append(first_table.getModel().accSeqName_arr[i])
		return seq_names
		
	def setAccSeqNames(self,seq_names):
		accl = self.linac_wizard_document.getAccl()
		if(len(seq_names) == 0): 
			accSeq = null
			self.linac_wizard_document.setAccSeq(accSeq)
			return
		lst = ArrayList()
		for seqName in seq_names:
			lst.add(accl.getSequence(seqName))
		accSeq = AcceleratorSeqCombo("SEQUENCE", lst)	
		self.linac_wizard_document.setAccSeq(accSeq)
		
	def getCavNameNodeDict(self,accl):
		rf_gaps = accl.getAllNodesWithQualifier(AndTypeQualifier().and((OrTypeQualifier()).or(RfGap.s_strType)))	
		cavs = []
		for rf_gap in rf_gaps:
			cav = rf_gap.getParent()
#.........这里部分代码省略.........
开发者ID:kritha,项目名称:MyOpenXal,代码行数:103,代码来源:linac_setup_cntrl_lib.py


注:本文中的javax.swing.JTable.setFillsViewportHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。