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


Python JScrollPane.rowHeaderView方法代码示例

本文整理汇总了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
开发者ID:aeriksson,项目名称:geogebra,代码行数:54,代码来源:gui.py

示例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()
开发者ID:Serabe,项目名称:geogebra,代码行数:41,代码来源:gui.py


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