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


Python JButton.setActionCommand方法代码示例

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


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

示例1: __init__

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
    def __init__(self, frame, chart, pingFun):
        JDialog(frame)
        self.setTitle("Chart Settings")
        self.setModal(True)
        self.pingFun = pingFun
        pane = self.getRootPane().getContentPane()
        pane.setLayout(GridLayout(7, 2))
        pane.add(JLabel("Marker color"))
        self.markerPanel = self.createColorPanel(chart.markerColor, pane)
        pane.add(JLabel("Positive selection color"))
        self.posPanel = self.createColorPanel(chart.posColor, pane)
        pane.add(JLabel("Neutral color"))
        self.neuPanel = self.createColorPanel(chart.neuColor, pane)
        pane.add(JLabel("Balancing selection color "))
        self.balPanel = self.createColorPanel(chart.balColor, pane)

        self.add(JLabel("Label candidate selected loci"))
        self.selLabel = JCheckBox()
        self.selLabel.setSelected(chart.labelSelected)
        self.add(self.selLabel)
        self.add(JLabel("Label candidate neutral loci"))
        self.neuLabel = JCheckBox()
        self.neuLabel.setSelected(chart.labelNeutral)
        self.add(self.neuLabel)

        change = JButton("Change")
        change.setActionCommand("Change")
        change.addActionListener(self)
        pane.add(change)
        exit = JButton("Exit")
        exit.setActionCommand("Exit")
        exit.addActionListener(self)
        pane.add(exit)
        self.pack()
开发者ID:tiagoantao,项目名称:lositan,代码行数:36,代码来源:ChartConf.py

示例2: getControlPanel

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
def getControlPanel():
    global controlPanel
    controlPanel = JPanel()
    controlPanel.setLayout(BoxLayout(controlPanel, BoxLayout.Y_AXIS))
    for row in keyLayout:
        rowPanel = JPanel()
        rowPanel.setLayout(BoxLayout(rowPanel, BoxLayout.X_AXIS))
        controlPanel.add(rowPanel)
        for key in row:
            button = JButton(key[0], actionPerformed=handleKeyButton)
            button.setActionCommand(key[1])
            rowPanel.add(button)

    global terminalResult
    terminalResult = JTextArea()
    scroller = JScrollPane(terminalResult)
    terminalResult.setLineWrap(True)
    scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS)
    scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)
    controlPanel.add(scroller)

    global terminalInput
    termInputPanel = JPanel()
    termInputPanel.setLayout(BoxLayout(termInputPanel, BoxLayout.X_AXIS))
    termInputLabel = JLabel("Command")
    termInputPanel.add(termInputLabel)
    terminalInput = JTextField(actionPerformed=handleTerminalInput)
    minimumSize = terminalInput.getMinimumSize()
    maximumSize = terminalInput.getMaximumSize()
    terminalInput.setMaximumSize(Dimension(maximumSize.width, minimumSize.height))

    termInputPanel.add(terminalInput)
    controlPanel.add(termInputPanel)

    return controlPanel
开发者ID:sjp38,项目名称:ash,代码行数:37,代码来源:ashdi.py

示例3: __init__

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
    def __init__(self, frame, what, entries, pingFun):
        JDialog(frame, what)
        self.frame   = frame
        self.entries = entries
        self.pingFun = pingFun
        pane = self.getRootPane().getContentPane()

        self.ent_pane, self.ent_list, self.ent = self.createList(entries)
        pane.add(self.ent_pane, BorderLayout.WEST)

        actionPanel = JPanel()
        actionPanel.setLayout(GridLayout(20, 1))
        self.text = JTextField(20)
        actionPanel.add(self.text)
        change = JButton('Change')
        change.setActionCommand('Change')
        change.addActionListener(self)
        actionPanel.add(change)
        actionPanel.add(JLabel(''))
        quit = JButton('Exit')
        quit.setActionCommand('Exit')
        quit.addActionListener(self)
        actionPanel.add(quit)
        actionPanel.add(JLabel(''))
        pane.add(actionPanel, BorderLayout.CENTER)

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

示例4: add_button

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
 def add_button(self, text, action):
     index = len(self.actions)
     name = "button%i" % index
     button = JButton(text)
     self.panel.add(button)
     button.setActionCommand(name)
     button.addActionListener(self)
     self.actions[name] = action
     return button
开发者ID:Serabe,项目名称:geogebra,代码行数:11,代码来源:algo.py

示例5: __init__

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
    def __init__(self, frame, what, all, removed, pingFun):
        JDialog.__init__(self,frame, what)
        self.frame   = frame
        self.all     = all
        self.removed = removed 
        self.pingFun = pingFun
        pane = self.getRootPane().getContentPane()

        self.sel_pane, self.sel_list, self.sel = self.createList(all)
        pane.add(self.sel_pane, BorderLayout.WEST)

        button_panel = JPanel()
        button_panel.setLayout(GridLayout(8,1))
        button_panel.add(JLabel('<-- Selected'))
        button_panel.add(JLabel('Removed -->'))
        select = JButton('Select')
        select.setActionCommand('Select')
        select.addActionListener(self)
        button_panel.add(select)
        button_panel.add(JLabel(''))
        restrict = JButton('Remove')
        restrict.setActionCommand('Remove')
        restrict.addActionListener(self)
        button_panel.add(restrict)
        button_panel.add(JLabel(''))
        quit = JButton('Exit')
        quit.setActionCommand('Exit')
        quit.addActionListener(self)
        button_panel.add(quit)
        button_panel.add(JLabel(''))
        pane.add(button_panel, BorderLayout.CENTER)

        self.rem_pane, self.rem_list, self.rem = self.createList(removed)
        pane.add(self.rem_pane, BorderLayout.EAST)


        warning_panel = JPanel()
        warning_panel.add(JLabel("Warning: Removing/adding loci or pops might take some time!"))
        pane.add(warning_panel, BorderLayout.NORTH)

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

示例6: __init__

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
    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,代码行数:39,代码来源:SelPanel.py

示例7: createButton

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
def createButton(text, command, manager):
    button = JButton(text)
    button.setActionCommand(command)
    button.addActionListener(manager)
    return button
开发者ID:tiagoantao,项目名称:lositan,代码行数:7,代码来源:Main.py

示例8: __init__

# 需要导入模块: from javax.swing import JButton [as 别名]
# 或者: from javax.swing.JButton import setActionCommand [as 别名]
    def __init__(self, menuHandles, manager, isDominant, systemPanel, isTemporal=False):
        self.systemPanel = systemPanel
        self.knownPops = 0
        self.ignoreChanges = True
        JPanel()
        self.menuHandles = menuHandles
        self.isDominant = isDominant
        self.isTemporal = isTemporal
        if isDominant:
            self.setLayout(GridLayout(8, 2))
        else:
            self.setLayout(GridLayout(5, 2))
        if isTemporal:
            self.add(JLabel("Ne"))
            ne = JFormattedTextField(NumberFormat.getNumberInstance(Locale.US))
            ne.addPropertyChangeListener(self)
            self.ne = ne
            self.add(ne)
        else:
            self.add(JLabel("Attempted Fst"))
            fst = JFormattedTextField(NumberFormat.getNumberInstance(Locale.US))
            fst.addPropertyChangeListener(self)
            self.fst = fst
            self.add(fst)
        self.add(JLabel("Expected total pops"))
        pops = JFormattedTextField(NumberFormat.getIntegerInstance(Locale.US))
        pops.addPropertyChangeListener(self)
        # self.pops = JComboBox(['1', '2', '4', '8', '12', '16'])
        self.pops = pops
        self.add(self.pops)
        if not isDominant and not isTemporal:
            self.add(JLabel("Mutation model"))
            self.mut = JComboBox(["Infinite Alleles", "Stepwise"])
            self.mut.addItemListener(self)
            self.add(self.mut)
        self.add(JLabel("Subsample size"))
        sampleSize = JFormattedTextField(NumberFormat.getIntegerInstance(Locale.US))
        sampleSize.addPropertyChangeListener(self)
        self.sampleSize = sampleSize
        self.add(self.sampleSize)
        if isDominant:
            self.add(JLabel("Theta"))
            theta = JFormattedTextField(NumberFormat.getNumberInstance(Locale.US))
            theta.addPropertyChangeListener(self)
            self.theta = theta
            self.add(theta)
            theta.setValue(0.1)

            self.add(JLabel("Beta-a"))
            beta1 = JFormattedTextField(NumberFormat.getNumberInstance(Locale.US))
            beta1.addPropertyChangeListener(self)
            self.beta1 = beta1
            self.add(beta1)
            beta1.setValue(0.25)

            self.add(JLabel("Beta-b"))
            beta2 = JFormattedTextField(NumberFormat.getNumberInstance(Locale.US))
            beta2.addPropertyChangeListener(self)
            self.beta2 = beta2
            self.add(beta2)
            beta2.setValue(0.25)

            self.add(JLabel("Critical frequency"))
            crit = JFormattedTextField(NumberFormat.getNumberInstance(Locale.US))
            crit.addPropertyChangeListener(self)
            self.crit = crit
            self.add(crit)
            crit.setValue(0.99)

        run = JButton("Run!")
        run.addActionListener(manager)
        run.setActionCommand("RunFDist")
        self.run = run
        self.add(run)
        cancel = JButton("Stop")
        cancel.addActionListener(manager)
        cancel.setActionCommand("CancelFDist")
        self.cancel = cancel
开发者ID:samitha,项目名称:lositan,代码行数:80,代码来源:EmpiricalPanel.py


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