当前位置: 首页>>代码示例>>Python>>正文


Python DockPanel.setVerticalAlignment方法代码示例

本文整理汇总了Python中pyjamas.ui.DockPanel.DockPanel.setVerticalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Python DockPanel.setVerticalAlignment方法的具体用法?Python DockPanel.setVerticalAlignment怎么用?Python DockPanel.setVerticalAlignment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.ui.DockPanel.DockPanel的用法示例。


在下文中一共展示了DockPanel.setVerticalAlignment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setVerticalAlignment [as 别名]
    def __init__(self):
        Sink.__init__(self)
        self.curImage=0
        self.image=Image()
        self.loadingImage = Image(self.baseURL() + "images/blanksearching.gif")
        self.nextButton = Image(self.baseURL() + "rembrandt/forward.gif")
        self.prevButton = Image(self.baseURL() + "rembrandt/back.gif")
        self.sImages=["rembrandt/JohannesElison.jpg", "rembrandt/LaMarcheNocturne.jpg", "rembrandt/SelfPortrait1628.jpg", "rembrandt/SelfPortrait1640.jpg", "rembrandt/TheArtistInHisStudio.jpg", "rembrandt/TheReturnOfTheProdigalSon.jpg"]

        for i in range(len(self.sImages)):
            self.sImages[i]=self.baseURL() + self.sImages[i]
        
        self.image.addLoadListener(self)
        self.prevButton.addClickListener(self)
        self.nextButton.addClickListener(self)
        
        topPanel = DockPanel()
        topPanel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        topPanel.add(self.prevButton, DockPanel.WEST)
        topPanel.add(self.nextButton, DockPanel.EAST)
        topPanel.add(self.loadingImage, DockPanel.CENTER)
        
        panel = VerticalPanel()
        panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        panel.add(HTML("<h2>A Bit of Rembrandt</h2>", True))
        panel.add(topPanel)
        panel.add(self.image)
        
        panel.setWidth("100%")
        self.initWidget(panel)
        self.image.setStyleName("ks-images-Image")
        self.nextButton.setStyleName("ks-images-Button")
        self.prevButton.setStyleName("ks-images-Button")
        
        self.loadImage(0)           
开发者ID:brodybits,项目名称:pyjs,代码行数:37,代码来源:Images.py

示例2: __init__

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setVerticalAlignment [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")
开发者ID:aprovodi,项目名称:mlServerCalculations,代码行数:34,代码来源:kMeans.py

示例3: NavBar

# 需要导入模块: from pyjamas.ui.DockPanel import DockPanel [as 别名]
# 或者: from pyjamas.ui.DockPanel.DockPanel import setVerticalAlignment [as 别名]
class NavBar(Composite):

    def __init__(self, owner):
        Composite.__init__(self)
        self.owner = owner
        self.bar = DockPanel()
        self.gotoFirst = Button("&lt;&lt;", self)
        self.gotoNext = Button("&gt;", self)
        self.gotoPrev = Button("&lt;", self)
        self.status = HTML()

        self.initWidget(self.bar)
        self.bar.setStyleName("navbar")
        self.status.setStyleName("status")

        buttons = HorizontalPanel()
        buttons.add(self.gotoFirst)
        buttons.add(self.gotoPrev)
        buttons.add(self.gotoNext)
        self.bar.add(buttons, DockPanel.EAST)
        self.bar.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT)
        self.bar.add(self.status, DockPanel.CENTER)
        self.bar.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        self.bar.setCellHorizontalAlignment(self.status, HasAlignment.ALIGN_RIGHT)
        self.bar.setCellVerticalAlignment(self.status, HasAlignment.ALIGN_MIDDLE)
        self.bar.setCellWidth(self.status, "100%")

        self.gotoPrev.setEnabled(False)
        self.gotoFirst.setEnabled(False)

    def onClick(self, sender):
        if sender == self.gotoNext:
            self.owner.startRow += self.owner.getDataRowCount()
            self.owner.refresh()
        elif sender == self.gotoPrev:
            self.owner.startRow -= self.owner.getDataRowCount()
            if self.owner.startRow < 0:
                self.owner.startRow = 0
            self.owner.refresh()
        elif sender == self.gotoFirst:
            self.owner.startRow = 0
            self.owner.refresh()
开发者ID:Afey,项目名称:pyjs,代码行数:44,代码来源:DynaTableWidget.py


注:本文中的pyjamas.ui.DockPanel.DockPanel.setVerticalAlignment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。