本文整理汇总了Python中javax.swing.JScrollPane.rowHeaderView方法的典型用法代码示例。如果您正苦于以下问题:Python JScrollPane.rowHeaderView方法的具体用法?Python JScrollPane.rowHeaderView怎么用?Python JScrollPane.rowHeaderView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JScrollPane
的用法示例。
在下文中一共展示了JScrollPane.rowHeaderView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from javax.swing import JScrollPane [as 别名]
# 或者: from javax.swing.JScrollPane import rowHeaderView [as 别名]
def __init__(self, window, api):
self.api = api
self.component = JPanel(BorderLayout())
# Create editor pane
scrollpane = JScrollPane()
self.script_area = InputPane(window)
self.script_area.undo = UndoManager()
line_numbers = LineNumbering(self.script_area.component)
scrollpane.viewport.view = self.script_area.component
scrollpane.rowHeaderView = line_numbers.component
self.component.add(scrollpane, BorderLayout.CENTER)
# Create Selection pane
select_pane = JPanel()
self.objects_box = JComboBox([], actionCommand="object")
select_pane.add(self.objects_box)
self.events_box = JComboBox(
["update", "click"],
actionCommand="event"
)
self.event_types = [EventType.UPDATE, EventType.CLICK]
select_pane.add(self.events_box)
self.languages = list(ScriptType.values())
self.language_box = JComboBox(
[l.getName() for l in self.languages],
actionCommand="language"
)
select_pane.add(self.language_box)
self.save_btn = JButton("Save")
select_pane.add(self.save_btn)
self.component.add(select_pane, BorderLayout.PAGE_START)
self.events_box.addActionListener(self)
self.objects_box.addActionListener(self)
self.language_box.addActionListener(self)
self.save_btn.addActionListener(self)
self.current = None
self.update_geos()
interface.addEventListener("add", self.event_listener)
interface.addEventListener("remove", self.event_listener)
interface.addEventListener("rename", self.event_listener)
# Listen to script_area changes in order to know when the save
# button can be activated
self.script_area.doc.addDocumentListener(self)
# Hack to be able to change the objects_box
self.building_objects_box = False
self.active = False
示例2: __init__
# 需要导入模块: from javax.swing import JScrollPane [as 别名]
# 或者: from javax.swing.JScrollPane import rowHeaderView [as 别名]
def __init__(self, interface):
self.interface = interface
self.frame = JFrame("Python Window")
tabs = JTabbedPane()
# Create Interactive Pane
interactive_pane = JPanel(BorderLayout())
scrollpane = JScrollPane()
inputPanel = JPanel()
inputPanel.layout = GridLayout(1, 1)
self.check_disabled = LockManager()
self.input = InteractiveInput(self.check_disabled, self.runcode)
self.input.component.document.addDocumentListener(self)
inputPanel.add(self.input.component)
self.outputpane = OutputPane()
scrollpane.viewport.view = self.outputpane.textpane
interactive_pane.add(scrollpane, BorderLayout.CENTER)
interactive_pane.add(inputPanel, BorderLayout.PAGE_END)
# Create Script Pane
script_pane = JPanel(BorderLayout())
scrollpane = JScrollPane()
self.script_area = script_area = InputPane()
line_numbers = LineNumbering(self.script_area.component)
scrollpane.viewport.view = self.script_area.component
scrollpane.rowHeaderView = line_numbers.component
script_pane.add(scrollpane, BorderLayout.CENTER)
tabs.addTab("Interactive", interactive_pane)
tabs.addTab("Script", script_pane)
self.frame.add(tabs)
self.frame.size = 500, 600
self.frame.visible = False
self.component = None
self.make_menubar()
self.history = InputHistory()