本文整理汇总了Python中javax.swing.JTable.setDefaultRenderer方法的典型用法代码示例。如果您正苦于以下问题:Python JTable.setDefaultRenderer方法的具体用法?Python JTable.setDefaultRenderer怎么用?Python JTable.setDefaultRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTable
的用法示例。
在下文中一共展示了JTable.setDefaultRenderer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SelPanel
# 需要导入模块: from javax.swing import JTable [as 别名]
# 或者: from javax.swing.JTable import setDefaultRenderer [as 别名]
#.........这里部分代码省略.........
falses = []
pys = []
for i in range(len(pv)):
p = self.getP(pv[i])
py = 1-2*abs(p-0.5)
pys.append(py)
#if p > ci or p<1-ci:
# pys.append(py)
pys.append(0.0)
pys.sort()
rate = []
maxRank=0
for i in range(len(pys)):
if pys[i]<=fdr*i/len(pys):
maxRank = i
#print maxRank
falseReports = []
for pvLine in pv:
p = self.getP(pvLine)
py = 1-2*abs(p-0.5)
if py in pys:
if pys.index(py)<=maxRank:
falseReports.append("Outlier")
else:
falseReports.append("--")
else:
falseReports.append("NA")
return falseReports
def initTable(self, lociNames, pv, ci, locusFst):
colNames = Vector()
colNames.add('Locus')
colNames.add('Het')
colNames.add('Fst')
colNames.add('P(simulated Fst < sample Fst)')
colNames.add('FDR')
data = Vector()
self.data = data
falses = self.calcFalsePositives(pv, ci, self.fdr)
currentPos = 0
for i in range(len(lociNames)):
line = Vector()
locus = lociNames[i]
line.add(locus)
if not locusFst[i]:
line.add("NA")
line.add("NA")
line.add("NA")
line.add("NA")
else:
line.add(str(pv[currentPos][0]))
line.add(str(pv[currentPos][1]))
line.add(str(self.getP(pv[currentPos])))
line.add(str(falses[currentPos]))
currentPos += 1
data.add(line)
self.table = JTable(data, colNames)
self.table.setDefaultRenderer(Class.forName("java.lang.Object"),
ColorRenderer(data, ci, self.chart.neuColor,
self.chart.balColor, self.chart.posColor))
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()