本文整理汇总了Python中pyjamas.ui.DockPanel.DockPanel.setHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python DockPanel.setHorizontalAlignment方法的具体用法?Python DockPanel.setHorizontalAlignment怎么用?Python DockPanel.setHorizontalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyjamas.ui.DockPanel.DockPanel
的用法示例。
在下文中一共展示了DockPanel.setHorizontalAlignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setHorizontalAlignment [as 别名]
def __init__(self):
Algorithm.__init__(self)
self.MLAlgorithmService = MLAlgorithmService(self)
self.image=Image(self.baseURL() + "services/kMeansPictures/lenna.png",Width="320px", Height="360px")
self.resultImage=Image("",Width="320px", Height="360px")
self.loadingImage = Image(self.baseURL() + "images/blanksearching.gif")
self.calculateButton = Button("RUN", self.onButtonClick)
self.log = Button("SHOW LOG", self.openLogFile)
self.log.setEnabled(False)
self.image.addLoadListener(self)
topPanel = DockPanel()
topPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
topPanel.add(self.calculateButton, DockPanel.WEST)
topPanel.add(self.loadingImage, DockPanel.CENTER)
topPanel.add(self.log, DockPanel.EAST)
panel = DockPanel()
panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
#panel.add(HTML("<h2>Image compression</h2>", True))
panel.add(topPanel, DockPanel.NORTH)
panel.add(self.image, DockPanel.WEST)
panel.add(self.resultImage, DockPanel.EAST)
panel.setWidth("100%")
self.initWidget(panel)
self.image.setStyleName("ks-images-Image")
self.calculateButton.setStyleName("ks-images-Button")
self.loadImage("picturem.png")