本文整理汇总了Python中javax.swing.JFrame.update方法的典型用法代码示例。如果您正苦于以下问题:Python JFrame.update方法的具体用法?Python JFrame.update怎么用?Python JFrame.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JFrame
的用法示例。
在下文中一共展示了JFrame.update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from javax.swing import JFrame [as 别名]
# 或者: from javax.swing.JFrame import update [as 别名]
def main():
binNaviProxy = StandAlone.getPluginInterface()
binNaviProxy.databaseManager.addDatabase("","com.mysql.jdbc.Driver","localhost","BINNAVI1","binnavi","binnavi",False,False)
db=binNaviProxy.databaseManager.databases[0]
db.connect()
db.load()
mods=db.getModules()
### initiate dialogBox to setect the module that should be used.
######################################################
frame = JFrame('BinNavi Module Selector',layout=BorderLayout(),
defaultCloseOperation = JFrame.EXIT_ON_CLOSE,
size = (1500, 800)
)
frame2 = JFrame('Function Selector',layout=BorderLayout(),
defaultCloseOperation = JFrame.EXIT_ON_CLOSE,
size = (30, 30)
)
frame2.setFocusableWindowState(False)
frame2.setFocusable(False)
frame2.setAlwaysOnTop(False)
#convert the module list into the string to be used in the TextBox.
textTemp = map((lambda x,y:"[%d]%s"%(x,y)),range(len(mods)),mods)
textStr=''.join(textTemp)
tx=JTextArea(textStr)
tx.setLineWrap(True);
tx.setWrapStyleWord(True);
frame.add(tx,BorderLayout.PAGE_START)
frame.visible = True
modInd = JOptionPane.showInputDialog(frame2, "Enter the index of the chosen module",
"Module selector");
#Open the module returned by the index
bfname=mods[int(modInd)] # this modules correxponds to the chosen module
bfname.load()
funcViews=bfname.views
#textTemp2 = ["[%d]%s"%(i,j) for i in range(len(funcViews)) for j in funcViews]
textTemp2=map((lambda x,y:"[%d]%s"%(x,y.toString()[5:18])),range(len(funcViews)),funcViews)
textStr1=''.join(textTemp2)
## remove the older text from the frame view
frame.remove(tx)
frame.update(frame.getGraphics())
frame.visible = False
## create a new textArea with the string made from all the functions' name
txStr=JTextArea(textStr1)
#tx.setsrcollOffset(20)
txStr.setLineWrap(True);
txStr.setWrapStyleWord(True);
frame.add(txStr,BorderLayout.PAGE_START)
frame.update(frame.getGraphics())
frame.visible = True
funcInd = JOptionPane.showInputDialog(frame2, "Enter the index of the function",
"Function selector");
######################################################
bffunc=bfname.views[int(funcInd)] #this is the view of the buildfname function
bffunc.load()
frame2.setVisible(False)
dispose(frame2)
bfReil=bffunc.getReilCode() # this is the REIL code of the function
bfReilGraph=bfReil.getGraph()
instGraph = InstructionGraph.create(bfReilGraph)
time.clock()
results=doAnalysis(instGraph)
totalTime=time.clock()
#print "resultsLen", len([r for r in results])
print "**** printing results *******\n"
print "Total time:", totalTime, '\n'
numNode=0
for n in instGraph:
numNode+=numNode
nIn=list(results.getState(n).inVal)
nIn.sort(key=itemgetter(0))
nOut=list(results.getState(n).out)
nOut.sort(key=itemgetter(0))
print '@@ ',n.getInstruction(),'\n'
print '\t In', nIn, '\n'
print '\t OUT', nOut, '\n'
print '\t memory: ',results.getState(n).memoryWritten, '\n'
print "++++ Total instructions: %d +++++\n"%numNode
#finally close the view of the function
bffunc.close()
#print bffunc.isLoaded()
#junky=raw_input("function closed. enter any charater")
#.........这里部分代码省略.........