本文整理汇总了Python中javax.swing.JMenuItem.actionPerformed方法的典型用法代码示例。如果您正苦于以下问题:Python JMenuItem.actionPerformed方法的具体用法?Python JMenuItem.actionPerformed怎么用?Python JMenuItem.actionPerformed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JMenuItem
的用法示例。
在下文中一共展示了JMenuItem.actionPerformed方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initMenu
# 需要导入模块: from javax.swing import JMenuItem [as 别名]
# 或者: from javax.swing.JMenuItem import actionPerformed [as 别名]
def initMenu():
global glzz
tmenu = JMenu("testQ")
smellv = JMenuItem("smell view")
smellv.actionPerformed = lambda event : SmellView(glzz).go()
tmenu.add(smellv)
radialv = JMenuItem("radial suite view")
radialv.actionPerformed = lambda event : RadialSuiteView(glzz).go()
tmenu.add(radialv)
treesv = JMenuItem("tree suite view")
# treesv.actionPerformed = lambda event : displayTreeSuiteView(glzz)
treesv.actionPerformed = lambda event : TreeSuiteView(glzz).go()
tmenu.add(treesv)
tmenu.add(tcMenu())
smellp = JMenuItem("smell pie")
smellp.actionPerformed = lambda event : plotSmellFrequency()
tmenu.add(smellp)
gbar = Guess.getMainUIWindow().getGMenuBar()
gbar.add(tmenu)
gbar.getMenu(3).removeAll() # deface the layout menu
gbar.revalidate()
gbar.repaint()
示例2: tcMenu
# 需要导入模块: from javax.swing import JMenuItem [as 别名]
# 或者: from javax.swing.JMenuItem import actionPerformed [as 别名]
def tcMenu():
caseSubMenu = JMenu("case view")
for pkg in (entity == 'package'):
pkgSubMenu = JMenu(pkg.name)
cases = [ x.getNode2() for x in (pkg->(entity == 'testcase'))]
for case in cases:
caseItem = JMenuItem(case.name)
caseItem.actionPerformed = lambda event : viewCase(event.getActionCommand())
pkgSubMenu.add(caseItem)
caseSubMenu.add(pkgSubMenu)
return caseSubMenu
示例3: __addToSourceAction
# 需要导入模块: from javax.swing import JMenuItem [as 别名]
# 或者: from javax.swing.JMenuItem import actionPerformed [as 别名]
def __addToSourceAction(self):
srca = JMenuItem("toSource")
srca.actionPerformed = self.__loadSource
self.add(srca)
示例4: __addWriteMetricsAction
# 需要导入模块: from javax.swing import JMenuItem [as 别名]
# 或者: from javax.swing.JMenuItem import actionPerformed [as 别名]
def __addWriteMetricsAction(self):
mtra = JMenuItem("writeMetrics")
mtra.actionPerformed = self.__writeMetrics
self.add(mtra)
示例5: __addViewCaseAction
# 需要导入模块: from javax.swing import JMenuItem [as 别名]
# 或者: from javax.swing.JMenuItem import actionPerformed [as 别名]
def __addViewCaseAction(self):
casev = JMenuItem("viewCase")
casev.actionPerformed = self.__showCase
self.add(casev)