本文整理汇总了Python中javax.swing.JTable.getSelectionModel方法的典型用法代码示例。如果您正苦于以下问题:Python JTable.getSelectionModel方法的具体用法?Python JTable.getSelectionModel怎么用?Python JTable.getSelectionModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTable
的用法示例。
在下文中一共展示了JTable.getSelectionModel方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [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
示例2: __init__
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [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
示例3: __init__
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [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()
示例4: __init__
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [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
示例5: Magnet_and_BPM_Panel
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [as 别名]
class Magnet_and_BPM_Panel(JPanel):
def __init__(self,mebt_main_orbit_diff_cntrl):
self.mebt_main_orbit_diff_cntrl = mebt_main_orbit_diff_cntrl
self.setLayout(BorderLayout())
#----etched border
etched_border = BorderFactory.createEtchedBorder()
quad_titled_border = BorderFactory.createTitledBorder(etched_border,"Quads")
dc_titled_border = BorderFactory.createTitledBorder(etched_border,"Dipole Correctors")
bpm_titled_border = BorderFactory.createTitledBorder(etched_border,"BPMs")
#-------------------------------------------
quad_panel = JPanel(BorderLayout())
dc_panel = JPanel(BorderLayout())
bpm_panel = JPanel(BorderLayout())
quad_panel.setBorder(quad_titled_border)
dc_panel.setBorder(dc_titled_border)
bpm_panel.setBorder(bpm_titled_border)
self.quad_table = JTable(Magnet_Table_Model(self.mebt_main_orbit_diff_cntrl,self.mebt_main_orbit_diff_cntrl.quad_wrappers))
self.dc_table = JTable(Magnet_Table_Model(self.mebt_main_orbit_diff_cntrl,self.mebt_main_orbit_diff_cntrl.dc_wrappers))
self.quad_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
self.dc_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
self.bpm_table = JTable(BPM_Table_Model(self.mebt_main_orbit_diff_cntrl))
self.bpm_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
quad_panel.add(JScrollPane(self.quad_table),BorderLayout.CENTER)
dc_panel.add(JScrollPane(self.dc_table),BorderLayout.CENTER)
bpm_panel.add(JScrollPane(self.bpm_table),BorderLayout.CENTER)
#-------------------------------------------
self.dc_table.getSelectionModel().addListSelectionListener(DCs_Table_Selection_Listener(self.mebt_main_orbit_diff_cntrl))
#-------------------------------------------
read_magnets_button = JButton("Update Magnet Fields from EPICS")
read_magnets_button.addActionListener(Read_Magnets_Button_Listener(self.mebt_main_orbit_diff_cntrl))
button_panel = JPanel(FlowLayout(FlowLayout.LEFT,3,3))
button_panel.add(read_magnets_button)
#-------------------------------------------
tables_panel = JPanel(GridLayout(3,1,3,3))
tables_panel.add(quad_panel)
tables_panel.add(dc_panel)
tables_panel.add(bpm_panel)
self.add(tables_panel,BorderLayout.CENTER)
self.add(button_panel,BorderLayout.SOUTH)
示例6: __init__
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [as 别名]
#.........这里部分代码省略.........
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):
main_loop_cntrl_da = root_da.createChild("MAIN_CONTROLLER")
main_loop_cntrl_da.setValue("keep_cav_params",self.keepAllCavParams_RadioButton.isSelected())
示例7: __init__
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [as 别名]
class WS_Data_Analysis_Controller:
"""
This controller manages the WS data analysis.
Its panel is in the WS_LW_Acquisition_Controller panel.
"""
def __init__(self,ws_lw_acquisition_controller):
self.ws_lw_acquisition_controller = ws_lw_acquisition_controller
self.local_gauss_fitter = Local_Gauss_Fitter()
self.main_panel = JPanel(BorderLayout())
self.ws_records_table_model = WS_Records_Table_Model()
#----etched border
etched_border = BorderFactory.createEtchedBorder()
#---make the WS_Records_JTable + Graph Panel
self.records_table = JTable(self.ws_records_table_model)
self.records_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
self.records_table.setFillsViewportHeight(true)
#----set up records_table columns width
columnModel = self.records_table.getColumnModel()
columnModel.getColumn(0).setPreferredWidth(30)
columnModel.getColumn(1).setPreferredWidth(160)
columnModel.getColumn(2).setPreferredWidth(40)
columnModel.getColumn(3).setPreferredWidth(40)
columnModel.getColumn(4).setPreferredWidth(80)
columnModel.getColumn(5).setPreferredWidth(70)
columnModel.getColumn(6).setPreferredWidth(70)
#---------------------------------------------------
records_panel = JPanel(BorderLayout())
records_panel.add(JScrollPane(self.records_table), BorderLayout.CENTER)
knobs_gauss_panel = JPanel(BorderLayout())
records_panel.add(knobs_gauss_panel, BorderLayout.SOUTH)
records_panel.setBorder(etched_border)
#---records knobs ---------------------------------------------
records_knobs_panel = JPanel(FlowLayout(FlowLayout.CENTER,5,5))
guess_and_fit_button = JButton("Guess and Fit")
analysis_all_button = JButton("G&F All")
fit_button = JButton("Fit")
fit_all_button = JButton("Fit All")
send_to_twiss_button = JButton("Send to Twiss Analysis")
records_knobs_panel.add(guess_and_fit_button)
records_knobs_panel.add(analysis_all_button)
records_knobs_panel.add(fit_button)
records_knobs_panel.add(fit_all_button)
records_knobs_panel.add(send_to_twiss_button)
guess_and_fit_button.addActionListener(Guess_And_Fit_Listener(self.ws_lw_acquisition_controller))
fit_button.addActionListener(Fit_Listener(self.ws_lw_acquisition_controller))
fit_all_button.addActionListener(Fit_All_Listener(self.ws_lw_acquisition_controller))
analysis_all_button.addActionListener(Guess_And_Fit_All_Listener(self.ws_lw_acquisition_controller))
send_to_twiss_button.addActionListener(SendToAnalysis_Listener(self.ws_lw_acquisition_controller))
self.gauss_fit_param_panel = GaussFitDataPanel()
knobs_gauss_panel.add(records_knobs_panel, BorderLayout.NORTH)
knobs_gauss_panel.add(self.gauss_fit_param_panel, BorderLayout.SOUTH)
#---------------------------------------------------------
self.record_analysis_panel = JPanel(BorderLayout())
border = BorderFactory.createTitledBorder(etched_border,"WS/LW Wave Form Analysis")
self.record_analysis_panel.setBorder(border)
self.record_analysis_panel.add(records_panel, BorderLayout.WEST)
self.gpanel_WF = FunctionGraphsJPanel()
self.gpanel_WF.setLegendButtonVisible(true)
self.gpanel_WF.setChooseModeButtonVisible(true)
self.gpanel_WF.setName("Profile")
self.gpanel_WF.setAxisNames("pos, [mm]","Amp, [arb. units]")
self.gpanel_WF.setBorder(etched_border)
self.gpanel_WF.addVerticalLine(-1.0e+30,Color.red)
self.gpanel_WF.addVerticalLine(+1.0e+30,Color.red)
self.gpanel_WF.setVerLinesButtonVisible(true)
self.gpanel_WF.addDraggedVerLinesListener(Position_Limits_Listener(self.ws_lw_acquisition_controller))
self.record_analysis_panel.add(self.gpanel_WF, BorderLayout.CENTER)
self.main_panel.add(self.record_analysis_panel, BorderLayout.CENTER)
#---set up Listeners
self.records_table.getSelectionModel().addListSelectionListener(WS_Record_Table_Selection_Listener(self.ws_lw_acquisition_controller))
def setDataToGraphPanel(self,ws_record):
self.gpanel_WF.removeAllGraphData()
self.gpanel_WF.addGraphData(ws_record.gd_wf)
self.gpanel_WF.addGraphData(ws_record.gd_fit_wf)
示例8: QatDialog
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [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
#.........这里部分代码省略.........
示例9: PreferencesFrame
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import getSelectionModel [as 别名]
#.........这里部分代码省略.........
panel1.add(Box.createRigidArea(Dimension(0, 15)))
maxErrP = JPanel(BorderLayout(5, 0))
maxErrP.add(JLabel(self.app.strings.getString("max_errors_number")), BorderLayout.LINE_START)
maxErrP.add(self.maxErrorsNumberTextField, BorderLayout.CENTER)
p = JPanel(BorderLayout())
p.add(maxErrP, BorderLayout.PAGE_START)
p.setAlignmentX(Component.LEFT_ALIGNMENT)
panel1.add(p)
self.tabbedPane.addTab(self.app.strings.getString("tab_1_title"),
None,
panel1,
None)
#2 Tab: favourite zones
panel2 = JPanel(BorderLayout(5, 15))
panel2.setBorder(BorderFactory.createEmptyBorder(7, 7, 7, 7))
#status
topPanel = JPanel()
topPanel.setLayout(BoxLayout(topPanel, BoxLayout.Y_AXIS))
infoPanel = HtmlPanel(self.app.strings.getString("fav_zones_info"))
infoPanel.getEditorPane().addHyperlinkListener(self)
infoPanel.setAlignmentX(Component.LEFT_ALIGNMENT)
self.favZoneStatusCBtn = JCheckBox(self.app.strings.getString("activate_fav_area"),
actionListener=self)
self.favZoneStatusCBtn.setToolTipText(self.app.strings.getString("activate_fav_area_tooltip"))
self.favZoneStatusCBtn.setAlignmentX(Component.LEFT_ALIGNMENT)
topPanel.add(infoPanel)
topPanel.add(Box.createRigidArea(Dimension(0, 10)))
topPanel.add(self.favZoneStatusCBtn)
#table
self.zonesTable = JTable()
tableSelectionModel = self.zonesTable.getSelectionModel()
tableSelectionModel.addListSelectionListener(ZonesTableListener(self))
columns = ["",
self.app.strings.getString("Type"),
self.app.strings.getString("Name")]
tableModel = ZonesTableModel([], columns)
self.zonesTable.setModel(tableModel)
self.scrollPane = JScrollPane(self.zonesTable)
#map
self.zonesMap = JMapViewer()
self.zonesMap.setZoomContolsVisible(False)
self.zonesMap.setMinimumSize(Dimension(100, 200))
#buttons
self.removeBtn = JButton(self.app.strings.getString("Remove"),
ImageProvider.get("dialogs", "delete"),
actionPerformed=self.on_removeBtn_clicked)
self.removeBtn.setToolTipText(self.app.strings.getString("remove_tooltip"))
newBtn = JButton(self.app.strings.getString("New"),
ImageProvider.get("dialogs", "add"),
actionPerformed=self.on_newBtn_clicked)
newBtn.setToolTipText(self.app.strings.getString("new_tooltip"))
#layout
panel2.add(topPanel, BorderLayout.PAGE_START)
panel2.add(self.scrollPane, BorderLayout.LINE_START)
panel2.add(self.zonesMap, BorderLayout.CENTER)
self.buttonsPanel = JPanel()
self.buttonsPanel.add(self.removeBtn)
self.buttonsPanel.add(newBtn)
panel2.add(self.buttonsPanel, BorderLayout.PAGE_END)
self.tabbedPane.addTab(self.app.strings.getString("tab_2_title"),