本文整理汇总了Python中pyjamas.ui.FlexTable.FlexTable类的典型用法代码示例。如果您正苦于以下问题:Python FlexTable类的具体用法?Python FlexTable怎么用?Python FlexTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FlexTable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: ProblemTab
class ProblemTab(EntityTab):
def __init__(self,app, pid):
global gw
EntityTab.__init__(self, app)
self.table = FlexTable()
self.table.setHTML(0, 0, "<b>Implement me</b>")
self.add("Foo problem "+pid)
开发者ID:antialize,项目名称:djudge,代码行数:7,代码来源:main.py
示例2: __init__
def __init__(self):
try:
FlexTable.__init__(self)
self.cols = len(self.columns)
self.setVisible(False)
except:
raise
开发者ID:certik,项目名称:pyjamas,代码行数:7,代码来源:Summary.py
示例3: __init__
def __init__(self):
VerticalPanel.__init__(self, Width="500px", Height="300px")
table = FlexTable()
for i, sentence in enumerate(["The dog is red", "The cat is blue", "The bear is green"]):
table.setWidget(i, 0, CodeSwitchingSentence(sentence))
self.add(table)
开发者ID:ryancotterell,项目名称:Choban,代码行数:9,代码来源:CodeSwitch.py
示例4: listResults
def listResults(self):
#Window.alert(str(len(self.results)))
row = 0
Entry = FlexTable()
Entry.addStyleName("comments")
for r in self.results:
self.addRow(Entry,r, row)
row = row+1
self.mainPanel.add(Entry)
开发者ID:cy245,项目名称:TextbookConnect,代码行数:9,代码来源:search_resultst.py
示例5: __init__
def __init__(self):
try:
FlexTable.__init__(self)
self.cols = len(self.columns)
self.addHeader()
self.addRow()
self.currentRow = self.rows
self.addRow()
self.getWidget(1, 0).setFocus(True)
except:
raise
开发者ID:Afey,项目名称:pyjs,代码行数:11,代码来源:TimeGrid.py
示例6: __init__
def __init__(self, tokens):
"""
Note that here tokens must be a list of lists
"""
VerticalPanel.__init__(self)
table = FlexTable()
self.bio_widgets = []
for i, token_list in enumerate(tokens):
self.bio_widgets.append(BIOhighlighter(i, token_list))
table.setWidget(i, 0, self.bio_widgets[i])
self.add(table)
开发者ID:stevenbedrick,项目名称:Choban,代码行数:13,代码来源:BIO.py
示例7: flextable
def flextable(data):
table = FlexTable()
rows = len(data)
columns = len(data[0])
datalist = flatten(data)
columnlist = flatten([range(columns) for x in range(rows)])
rowlist = flatten([[x for y in range(columns)]
for x in range(rows)])
tablelist = zip(rowlist,columnlist,datalist)
for x in tablelist:
table.setText(x[0],x[1],x[2])
table.setBorderWidth(2)
return table
开发者ID:haskellpostgresprogrammer,项目名称:python_files,代码行数:13,代码来源:mywidgets.py
示例8: __init__
def __init__(self, left = 50, top = 50):
DialogBox.__init__(self, modal = False)
self.setPopupPosition(left, top)
self.setText("Preferences")
ftable = FlexTable()
ftableFormatter = ftable.getFlexCellFormatter()
row = 0
try:
self.fileLocation = getCookie("fileLocation")
except:
self.fileLocation = None
row += 1
ftable.setWidget(row, 0, Label("Sheet loaded on startup", wordWrap=False))
self.fileLocationInput = TextBox()
self.fileLocationInput.addChangeListener(self.checkValid)
self.fileLocationInput.addKeyboardListener(self)
self.fileLocationInput.setVisibleLength(30)
self.fileLocationInput.setText(self.fileLocation)
ftable.setWidget(row, 1, self.fileLocationInput)
row += 1
hpanel = HorizontalPanel()
self.saveBtn = Button("Save", self.onSave)
self.saveBtn.setEnabled(False)
hpanel.add(self.saveBtn)
self.cancelBtn = Button("Cancel", self.onCancel)
hpanel.add(self.cancelBtn)
ftable.setWidget(row, 0, hpanel)
ftableFormatter.setColSpan(row, 0, 2)
self.setWidget(ftable)
开发者ID:Afey,项目名称:pyjs,代码行数:34,代码来源:PreferencesDlg.py
示例9: __init__
def __init__(self):
VerticalPanel.__init__(self)
table = FlexTable()
sentences = self.get_stimuli()
sentence_widgets = []
self.sentence_set = BIO.BIOSentenceSet(sentences,[x.split() for x in sentences])
table.setWidget(0,0,self.sentence_set)
self.add(table)
开发者ID:lukeorland,项目名称:Choban,代码行数:15,代码来源:NERLocal.py
示例10: __init__
def __init__(self,sentences,tokens):
"""
Note that here tokens must be a list of lists
"""
VerticalPanel.__init__(self)
options = ["Not Selected","Person","Location","Organization","Date","Time","Money","Percent","Url","Email","Telephone Number","English (Code Switching)"]
table = FlexTable()
self.bio_widgets = []
for i,pair in enumerate(zip(sentences,tokens)):
self.bio_widgets.append(BIOHighlighterDropDown(i,pair[0],pair[1],options))
table.setWidget(i,0,self.bio_widgets[i])
self.add(table)
开发者ID:lukeorland,项目名称:Choban,代码行数:16,代码来源:BIO.py
示例11: __init__
def __init__(self, app):
DialogBox.__init__(self)
self.app = app
self.table=FlexTable()
self.table.setText(0, 0, "Please enter username and password")
self.table.getFlexCellFormatter().setColSpan(0, 0, 2)
self.table.setText(1, 0, "Username")
self.handle = TextBox()
h = getCookie('handle')
self.handle.setText(h)
self.table.setWidget(1, 1, self.handle)
self.table.setText(2, 0, "Password")
self.pwd = PasswordTextBox()
self.table.setWidget(2, 1, self.pwd)
self.table.setHTML(3,0,"")
self.table.getFlexCellFormatter().setColSpan(3, 0, 2)
h = HorizontalPanel()
self.table.setWidget(4,0, h)
self.table.getFlexCellFormatter().setColSpan(4, 0, 2)
h.add(Button("Ok", getattr(self, "onOk")))
h.add(Button("Cancel", getattr(self, "onClose")))
h.setSpacing(4)
self.setHTML("<b>Login</b>")
self.setWidget(self.table)
left = (Window.getClientWidth() - 200) / 2
top = (Window.getClientHeight() - 100) / 2
self.setPopupPosition(left,top)
开发者ID:antialize,项目名称:djudge,代码行数:28,代码来源:main.py
示例12: __init__
def __init__(self, autoHide=None, modal=True, **kwargs):
# Init section
self.dragging = False
self.dragStartX = 0
self.dragStartY = 0
self.child = None
self.panel = FlexTable(
Height="100%",
BorderWidth="0",
CellPadding="0",
CellSpacing="0",
)
cf = self.panel.getCellFormatter()
cf.setHeight(1, 0, "100%")
cf.setWidth(1, 0, "100%")
cf.setAlignment(
1, 0,
HasHorizontalAlignment.ALIGN_CENTER,
HasVerticalAlignment.ALIGN_MIDDLE,
)
# Arguments section
self.modal = modal
self.caption = HTML()
self.panel.setWidget(0, 0, self.caption)
self.caption.setStyleName("Caption")
self.caption.addMouseListener(self)
# Finalize
kwargs['StyleName'] = kwargs.get('StyleName', "gwt-DialogBox")
PopupPanel.__init__(self, autoHide, modal, **kwargs)
PopupPanel.setWidget(self, self.panel)
开发者ID:anandology,项目名称:pyjamas,代码行数:32,代码来源:DialogBox.py
示例13: __init__
def __init__(self):
SimplePanel.__init__(self)
self._table = FlexTable(BorderWidth=1, Width="100%")
cellFormatter = self._table.getFlexCellFormatter()
rowFormatter = self._table.getRowFormatter()
self._table.setHTML(0, 0, "<b>Mammals</b>")
self._table.setText(1, 0, "Cow")
self._table.setText(1, 1, "Rat")
self._table.setText(1, 2, "Dog")
cellFormatter.setColSpan(0, 0, 3)
cellFormatter.setHorizontalAlignment(0, 0, HasAlignment.ALIGN_CENTER)
self._table.setWidget(2, 0, Button("Hide", getattr(self, "hideRows")))
self._table.setText(2, 1, "1,1")
self._table.setText(2, 2, "2,1")
self._table.setText(3, 0, "1,2")
self._table.setText(3, 1, "2,2")
cellFormatter.setRowSpan(2, 0, 2)
cellFormatter.setVerticalAlignment(2, 0, HasAlignment.ALIGN_MIDDLE)
self._table.setWidget(4, 0, Button("Show", getattr(self, "showRows")))
cellFormatter.setColSpan(4, 0, 3)
rowFormatter.setVisible(4, False)
self.add(self._table)
开发者ID:Afey,项目名称:pyjs,代码行数:32,代码来源:flexTable.py
示例14: __init__
def __init__(self, **kwargs):
FlexTable.__init__(self, **kwargs)
FocusHandler.__init__(self)
self.buttons = {}
fmt = self.getFlexCellFormatter()
for i, row in enumerate(rows):
for j, letter in enumerate(row):
if letter == ' ':
l = ' '
else:
l = letter
button = Button(l, self, StyleName="kbdbutton")
self.buttons[letter] = button
self.setWidget(i, j, button)
if letter == ' ':
fmt.setColSpan(i, j, 5)
button.addStyleName("kbdbuttonspace")
开发者ID:davelab6,项目名称:telaro,代码行数:17,代码来源:keyboard.py
示例15: __init__
def __init__(self,questions,unique_id):
"""
questions is a list of tuples
the first value is a string repreesnting the question
the second value is a boolean value that represents whether the question is true/false
`
("Are you a native Spanish speaker?",true)
("How old are you",false)
"""
VerticalPanel.__init__(self)
self.unique_id = unique_id
self.answers = []
table = FlexTable()
for i,question in enumerate(questions):
table.setWidget(i,0,HTML(question[0]))
if (question[1] == True):
radio1 = RadioButton("truefalse","Yes")
radio2 = RadioButton("truefalse","No")
self.answers.append((question[0],question[1],(radio1,radio2)))
radiotable = FlexTable()
radiotable.setWidget(0,0,radio1)
radiotable.setWidget(0,1,radio2)
table.setWidget(i,1,radiotable)
else:
textbox = TextBox()
self.answers.append((question[0],question[1],textbox))
table.setWidget(i,1,textbox)
if (not self.is_cookie_set()):
self.add(HTML("<p><strong>Please fill out this quick survey.</strong> (You will only have to do so once)</p>"))
self.add(table)
开发者ID:lukeorland,项目名称:Choban,代码行数:45,代码来源:TurkerInfo.py
示例16: __init__
def __init__(self):
VerticalPanel.__init__(self,Width="500px",Height="300px")
# mturk_input = MTurk.MTurkInput()
# self.mturk_output = MTurk.MTurkOutput(True,mturk_input.assignmentId,mturk_input.hitId,mturk_input.workerId,self.write_data)
commit = Button("Submit",self)
table = FlexTable()
# sentences = mturk_input.params.values()
sentence_widgets = []
whatever = ["The quick brown fox jumps over the lazy dog","The quick brown fox jumps over the lazy dog"]
self.sentence_set = BIO.BIOSentenceSet(map(lambda x: x.split(),whatever))
table.setWidget(0,0,self.sentence_set)
table.setWidget(1,0,commit)
self.add(table)
开发者ID:stevenbedrick,项目名称:Choban,代码行数:19,代码来源:Sentiment.py
示例17: init
def init ( self, parent ):
""" Finishes initializing the editor by creating the underlying toolkit
widget.
"""
super( RadioEditor, self ).init( parent )
self.control = FlexTable( BorderWidth=0, Width="100%" )
self.control.addTableListener( self.update_object )
self.rebuild_editor()
开发者ID:rwl,项目名称:traitsbackendpyjamas,代码行数:10,代码来源:enum_editor.py
示例18: __init__
def __init__(self):
Composite.__init__(self)
panel = DockPanel(HorizontalAlignment=HasAlignment.ALIGN_CENTER,
VerticalAlignment=HasAlignment.ALIGN_MIDDLE)
panel.setWidth("100%")
vp = VerticalPanel()
grid = FlexTable(CellPadding=4, CellSpacing=4)
hp = HorizontalPanel()
handle_n = NextHandle(self)
handle_f = FinishHandle(self)
handle_c = ClearHandle(self)
self.next = Button("Next", handle_n, StyleName='button')
self.finish = Button("Finish!", handle_f, StyleName='button')
self.clear = Button("Clear", handle_c, StyleName='button')
hp.add(self.clear)
hp.add(self.finish)
hp.add(self.next)
hp.setWidth("70%")
vp.add(Label("Content-Based Image Retrieval Using OPF", StyleName='label'))
vp.add(grid)
vp.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT)
vp.add(hp)
cols = 4
for i in range(100):
im = Image('images/cbir/%d.jpg' % random.randint(0, 1000), Size=("200px", "150px"), StyleName='image-cool')
grid.setWidget(int(i/cols), i%cols, im)
panel.add(vp, DockPanel.CENTER)
self.initWidget(panel)
self.status = Label()
vp.add(self.status)
开发者ID:victormatheus,项目名称:cbir_pyjamas,代码行数:43,代码来源:cbir.py
示例19: UploadProblemTab
class UploadProblemTab(EntityTab):
def __init__(self,app):
EntityTab.__init__(self, app)
self.form = FormPanel()
self.form.setEncoding("multipart/form-data")
self.form.setMethod("post")
self.table = FlexTable()
self.table.setText(0,0,"Problem archive")
self.file = FileUpload()
self.file.setName("file");
self.table.setWidget(0,1,self.file)
self.form.setWidget(self.table)
self.button = Button("Submit",self)
self.table.setWidget(1,1, self.button)
self.msg = HTML("<b>Uploading</b>")
self.msg.setVisible(False)
self.cookie = Hidden()
self.cookie.setName("cookie")
self.table.setWidget(2,0, self.cookie)
self.table.setWidget(2,1, self.msg)
self.form.setWidget(self.table)
self.form.setAction("../upload.py/problem")
self.add("Upload new problem")
def onSubmitComplete(self,event):
self.msg.setVisible(False)
def onSubmit(self,evt):
self.msg.setVisible(True)
def onClick(self,evt):
if self.app.cookie == None:
self.app.login()
else:
self.cookie.setValue(self.app.cookie)
self.form.submit()
def getRoot(self):
return self.form
开发者ID:antialize,项目名称:djudge,代码行数:39,代码来源:main.py
示例20: __init__
def __init__(self, title):
DockPanel.__init__(self)
self.grid = FlexTable()
title = HTML(title)
self.add(title, DockPanel.NORTH)
self.setCellHorizontalAlignment(title,
HasHorizontalAlignment.ALIGN_LEFT)
self.add(self.grid, DockPanel.CENTER)
self.grid.setBorderWidth("0px")
self.grid.setCellSpacing("0px")
self.grid.setCellPadding("4px")
self.formatCell(0, 0)
self.grid.setHTML(0, 0, " ")
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:14,代码来源:InfoDirectory.py
注:本文中的pyjamas.ui.FlexTable.FlexTable类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论