• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python Image.Image类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

    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,代码行数:35,代码来源:Images.py


示例2: MechDrawing

class MechDrawing(VerticalPanel):
    def __init__(self, handle, idx, image, variables = None, code = None, 
                 perspective = '', checkOptions = [False, True]):
        VerticalPanel.__init__(self)
        self._handle = handle
        self.idx = idx
        # set style
        self.setStyleName('os-mech-drawing')  
        # create widgets
        self._img = Image(image)
        self._img.setStyleName('os-mech-thumb')
        self._img.addClickListener(self.onClickDrawing)
        self._perspective = '%d - %s'%(idx, perspective.capitalize())
        self._optionPanel = MechOptionPanel(handle, idx, checkOptions)
        textArea  = TextArea(code)
        textArea.setText(code)
        textArea.setStyleName('os-mech-code-locked')
        textArea.setReadonly(self, True)
        # populate drawing
        self.add(self._img)
        self.add(self._optionPanel)
        self.add(textArea)
    def actRatioChange(self, ratio):
        self._optionPanel.actRatioChange(ratio)
    def onClickDrawing(self, sender, event):
        Window.open(self._img.getUrl() + '&render=html&title=%s'%self._perspective, self._perspective, "status=1,resizeable=1,scrollbars=1")
开发者ID:OneSolver,项目名称:onesolver,代码行数:26,代码来源:Drawing.py


示例3: refresh_theorems

    def refresh_theorems(self, folder):
        self.remove_images()

        def onClick(theorem):
            def name(n):
                return "var" + str(n + 1)

            def print_scheme(n):
                return ["\\alpha", "\\beta", "\\gamma", "\\delta", "\\epsilon"][n]

            def poas(sender):
                if len(theorem.operations) == 1:
                    constants = [Operation("const" + str(i + 1), 0, print_scheme(i), name(i), Operation.EXPRESSION)
                                 for i in range(theorem.operations[0].no_of_args)]

                    def after1(f):
                        self.after(
                            theorem.formula.substitute_definition(Formula([theorem.operations[0]] + constants), f),
                            predecessors=[], rule_name="insert")

                    request_formula([op for op in proof.get_operations()] + constants,
                                    after1, type=('rel' if theorem.operations[0].type == Operation.RELATION else 'exp'))
                else:
                    self.after(theorem.formula, predecessors=[], rule_name="insert")

            return poas

        for ax in [x for x in Theorem.theorems if x.folder == folder]:
            im = Image()
            im.addClickListener(onClick(ax))
            im.setUrl(latex_to_url(ax.formula.to_latex()))
            self.pok.add(im)
            self.images.append(im)
开发者ID:vizafogo123,项目名称:pokpok,代码行数:33,代码来源:TheoremPanel.py


示例4: __init__

    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,代码行数:32,代码来源:kMeans.py


示例5: addToggleButton

 def addToggleButton(self, panel, imagep, tip):
     img = Image(imagep)
     img.setWidth("20px")
     img.setHeight("20px")
     tb = ToggleButton(img)
     self.addAnyButton(panel, tb, tip)
     return tb
开发者ID:Afey,项目名称:pyjs,代码行数:7,代码来源:RichTextEditor.py


示例6: setControls

 def setControls(self, minimize, maximize, close):
     if minimize is True:
         self.minimizeWidget = self.createDefaultControl('minimize')
     elif isinstance(minimize, basestring):
         self.minimizeWidget = Image(minimize)
     else:
         self.minimizeWidget = minimize
     if maximize is True:
         self.maximizeWidget = self.createDefaultControl('maximize')
     elif isinstance(maximize, basestring):
         self.maximizeWidget = Image(maximize)
     else:
         self.maximizeWidget = maximize
     if close is True:
         self.closeWidget = self.createDefaultControl('close')
     elif isinstance(close, basestring):
         self.closeWidget = Image(close)
     else:
         self.closeWidget = close
     if (isinstance(self.minimizeWidget, UIObject) or
         isinstance(self.maximizeWidget, UIObject) or
         isinstance(self.closeWidget, UIObject)):
         cf = self.panel.getCellFormatter()
         captionStyle = self.caption.getStyleName()
         captionPanel = FlexTable(
             Width="99%",
             BorderWidth="0",
             CellPadding="0",
             CellSpacing="0",
         )
         controls = HorizontalPanel()
         controls.setStyleName("Controls")
         controls.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
         if isinstance(self.minimizeWidget, UIObject):
             self.minimizeWidget.setStyleName("Minimize")
             controls.add(self.minimizeWidget)
             self.minimizeWidget.addClickListener(
                 getattr(self, "onMinimize"),
             )
         if isinstance(self.maximizeWidget, UIObject):
             self.maximizeWidget.setStyleName("Maximize")
             controls.add(self.maximizeWidget)
             self.maximizeWidget.addClickListener(
                 getattr(self, "onMaximize"),
             )
         if isinstance(self.closeWidget, UIObject):
             self.closeWidget.setStyleName("Close")
             controls.add(self.closeWidget)
             self.closeWidget.addClickListener(
                 getattr(self, "onClose"),
             )
             self.closeable = True
         self.caption.removeStyleName(captionStyle)
         self.panel.setWidget(0, 0, captionPanel)
         captionPanel.setWidget(0, 0, self.caption)
         captionPanel.setWidget(0, 1, controls)
         captionPanel.setStyleName(captionStyle)
         cf = captionPanel.getCellFormatter()
         cf.setWidth(0, 1, '1%')
开发者ID:anthonyrisinger,项目名称:translate-pyjs-org.appspot.com,代码行数:59,代码来源:DialogWindow.py


示例7: __init__

 def __init__(self, no, up_img, down_img):
     self.x = 0
     self.y = 0
     self.no = no
     self.up_img = up_img
     self.down_img = down_img
     Image.__init__(self, up_img)
     self.setStyleName("gwt-Image-Cell")
开发者ID:vijayendra,项目名称:Puzzle-Game,代码行数:8,代码来源:Puzzle.py


示例8: addPushButton

    def addPushButton(self, panel, imagep, tip):
        img = Image(imagep)
        img.setWidth("20px")
        img.setHeight("20px")

        pb = PushButton(img)
        self.addAnyButton(panel, pb, tip)
        return pb
开发者ID:Afey,项目名称:pyjs,代码行数:8,代码来源:RichTextEditor.py


示例9: __init__

    def __init__(self):
        SimplePanel.__init__(self)

        # We display the "myImage.jpg" file, stored in the "public/images"
        # directory, where "public" is in the application's source directory.

        img = Image("images/myImage.jpg")
        img.addClickListener(getattr(self, "onImageClicked"))
        self.add(img)
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:image.py


示例10: createImage

    def createImage(self, imageUrl):
        image = Image(imageUrl)
        image.setStyleName("ks-images-Image")

        p = VerticalPanel()
        p.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
        p.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
        p.add(image)
        return p
开发者ID:Afey,项目名称:pyjs,代码行数:9,代码来源:Tabs.py


示例11: prepareImage

 def prepareImage(self, url):
     img = Image()
     img.__isLoaded = False
     img.addLoadListener(self)
     # normally, event listeners are only set up when the widget
     # is attached to part of the DOM (see Widget.onAttach).  but,
     # in this case, we want a load even _even though_ the Image
     # widget is not yet attached (and quite likely won't be).
     DOM.setEventListener(img.getElement(), img)
     return img
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:10,代码来源:ImageLoader.py


示例12: add_formula

 def add_formula(self, f):
     h = HorizontalPanel()
     im = Image()
     im.setUrl(latex_to_url(f.to_latex()))
     c = CheckBox()
     h.add(c)
     h.add(im)
     self.pok.add(h)
     self.checkbox_list.append(c)
     self.hpanel_list.append(h)
     self.image_list.append(im)
开发者ID:vizafogo123,项目名称:pokpok,代码行数:11,代码来源:FormulaListPanel.py


示例13: FormulaBuilder

class FormulaBuilder(DialogWindow):

    def __init__(self, operations,after,type='rel'):
        DialogWindow.__init__(self, modal=True, close=True)
        self.formula = Formula([])
        self.after=after

        left = 100
        top = 100

        self.ops_with_buttons = [{"op": op, "button": Button(op.name, self)} for op in operations if op.available]
        dock = DockPanel()
        dock.setSpacing(3)

        for owb in self.ops_with_buttons:
            dock.add(owb['button'], DockPanel.NORTH)

        dock.setWidth("300")

        self.image = Image(latex_to_url(self.formula.fill_with_placeholders().to_latex()))
        dock.add(self.image, DockPanel.EAST)
        dock.setCellHorizontalAlignment(self.image, HasAlignment.ALIGN_TOP)

        self.doneButton=Button("Done",self)
        self.doneButton.setEnabled(False)
        dock.add(self.doneButton,DockPanel.SOUTH)

        dock.add(HTML(""),DockPanel.CENTER)

        self.setText("opkop")
        self.setPopupPosition(left, top)
        self.setStyleAttribute("background-color", "#ffffff")
        self.setStyleAttribute("color", "blue")
        self.setStyleAttribute("border-width", "5px")
        self.setStyleAttribute("border-style", "solid")

        self.setWidget(dock)

    def onClick(self, sender):
        if sender==self.doneButton:
            self.hide()
            self.after(self.formula)

        op=None
        for owb in self.ops_with_buttons:
            if owb['button'] == sender:
                self.setText(sender.getText())
                op=owb['op']

        if not self.formula.is_closed():
            self.formula.add_one_op(op,type)
            self.image.setUrl(latex_to_url(self.formula.fill_with_placeholders().to_latex()))
            if self.formula.is_closed():
                self.doneButton.setEnabled(True)
开发者ID:vizafogo123,项目名称:pokpok,代码行数:54,代码来源:Trees.py


示例14: make_footer

    def make_footer(self):
        self.time = {}

        self.time['hour'] = ListBox()
        self.time['hour'].setVisibleItemCount(1)
        for hour in range(24):
            self.time['hour'].addItem('%02d' % hour)
        self.time['hour'].setSelectedIndex(12)

        self.time['minute'] = ListBox()
        self.time['minute'].setVisibleItemCount(1)
        for minute in range(0, 60, 5):
            self.time['minute'].addItem('%02d' % minute)
        self.time['minute'].setSelectedIndex(0)

        time_panel = HorizontalPanel()
        time_panel.setVerticalAlignment('center')
        time_panel.add(self.time['hour'])
        time_panel.add(Label(':'))
        time_panel.add(self.time['minute'])
        self.table.setWidget(1, 0, time_panel)

        weekdays_panel = HorizontalPanel()
        weekdays_panel.setSpacing(5)
        self.weekdays = {}
        for i in range(7):
            self.weekdays[i] = CheckBox(AlarmWidget.weekday_name[i])
            self.weekdays[i].setChecked(i < 6)
            weekdays_panel.add(self.weekdays[i])
        self.table.setWidget(1, 1, weekdays_panel)

        self.duration = ListBox()
        self.duration.setVisibleItemCount(1)
        choices = [ 1, 2, 3, 4, 5, 7, 10, 15, 20, 25, 30, 40, 50, 60 ]
        for seconds in choices:
            self.duration.addItem(
                    '%ds' % seconds if seconds < 60 else '%dm' % (seconds / 60),
                    seconds)
        self.duration.setSelectedIndex(2)
        self.table.setWidget(1, 2, self.duration)

        image = Image('icons/plus.png')
        image.setTitle('add');
        image.addClickListener(self.plus_clicked)
        self.table.setWidget(1, 3, image)

        for col in range(4):
            self.table.getCellFormatter().setStyleName(1, col, 'tablecell noborder')
开发者ID:christophgysin,项目名称:schoolbell,代码行数:48,代码来源:alarmwidget.py


示例15: __init__

 def __init__(self, userListPanel, tabPanel, topPanel):
     VerticalPanel.__init__(self, StyleName='large-avatar-panel')
     self.userListPanel = userListPanel
     self.tabPanel = tabPanel
     self.topPanel = topPanel
     upperPanel = HorizontalPanel(StyleName='large-avatar-upper-panel',
                                  Spacing=8)
     self.image = Image(StyleName='large-avatar')
     self.upperText = HTML(StyleName='large-avatar-upper-text')
     upperPanel.add(self.image)
     upperPanel.add(self.upperText)
     self.add(upperPanel)
     self.lowerText = HTML(StyleName='large-avatar-lower-text')
     self.add(self.lowerText)
     self.followButton = None
     self.user = None
     insertPanel = HorizontalPanel(Spacing=3)
     insertPanel.add(Label('Use name: '))
     if tabPanel.tabName == 'simple':
         b1 = Button('upper', SimpleInserter(self, 'upper'))
         b2 = Button('lower', SimpleInserter(self, 'lower'))
         insertPanel.add(b1)
         insertPanel.add(b2)
     else:
         b1 = Button('or', QueryInserter(self, 'or'))
         b2 = Button('and', QueryInserter(self, 'and'))
         b3 = Button('except', QueryInserter(self, 'except'))
         insertPanel.add(b1)
         insertPanel.add(b2)
         insertPanel.add(b3)
     self.add(insertPanel)
开发者ID:jdunck,项目名称:Tickery,代码行数:31,代码来源:userlist.py


示例16: __init__

    def __init__(self):

        Sink.__init__(self)

        self.formula = AX_REG
        self.image1 = Image(latex_to_url(self.formula.fill_with_placeholders().to_latex()))
        self.cnf=self.formula.simplify().to_cnf()
        self.image2 = Image(latex_to_url(self.cnf.to_latex()))
        self.vars=self.cnf.get_vars()

        self.vars_with_proto = [{"var": var, "proto": Proto(var.name)} for var in self.vars]
        self.fProto = [
            Proto("Beethoven", [x["proto"] for x in self.vars_with_proto])
        ]

        self.fTree = Tree()

        for i in range(len(self.fProto)):
            self.createItem(self.fProto[i])
            self.fTree.addItem(self.fProto[i].item)

        self.fTree.addTreeListener(self)

        self.panel = HorizontalPanel(VerticalAlignment=HasAlignment.ALIGN_TOP)
        self.panel.setSpacing(40)
        self.panel.add(self.fTree)

        self.panel.add(self.image1)
        self.panel.add(self.image2)

        self.initWidget(self.panel)
开发者ID:vizafogo123,项目名称:pokpok,代码行数:31,代码来源:Trees.py


示例17: __init__

    def __init__(self, theorem, **kwargs):
        DialogWindow.__init__(self, modal=True, close=True)
        self.theorem=theorem
        v = VerticalPanel()
        v.setWidth(300)
        # v.setHeight(500)
        self.setText("save")
        self.setPopupPosition(100, 100)
        self.setStyleAttribute("background-color", "#ffffff")
        self.setStyleAttribute("color", "red")
        self.setStyleAttribute("border-width", "5px")
        self.setStyleAttribute("border-style", "solid")
        self.im=Image()
        self.im.setUrl(latex_to_url(self.theorem.formula.to_latex()))
        v.add(self.im)
        h=HorizontalPanel()
        self.radio=RadioButton("group1", "Existing folder:")
        h.add(self.radio)
        self.list = ListBox()
        self.list.setVisibleItemCount(1)
        for f in Theorem.get_all_folders():
            self.list.addItem(f)

        h.add(self.list)
        v.add(h)
        h=HorizontalPanel()
        h.add(RadioButton("group1", "New folder:"))
        self.radio.setChecked(True)
        self.textbox=TextBox()
        h.add(self.textbox)
        v.add(h)
        v.add(Button("Done",self.done_click))
        self.add(v)
开发者ID:vizafogo123,项目名称:pokpok,代码行数:33,代码来源:SaveDialog.py


示例18: onRemoteResponse

 def onRemoteResponse(self, result, request_info):
     if result['result']:
         self.sender.screenname = screenname = result['screen_name']
         h = HTML('%s&nbsp;' % utils.screennameToTwitterLink(screenname),
                  StyleName='logged-in-text')
         self.sender.setWidget(0, 0, h)
         logout = Image('logout.gif', StyleName='logout-image')
         logout.addMouseListener(self)
         self.sender.setWidget(0, 1, logout)
         remote = server.TickeryService()
         id = remote.friendsIds(self.sender.oauthCookie,
             screenname, SetFriends(screenname, self.sender))
         if id < 0:
             self.sender.setWidget(
                 0, 1, Label("Oops: Couldn't fetch friends."))
     else:
         self.sender.notLoggedIn()
开发者ID:fluidinfo,项目名称:Tickery,代码行数:17,代码来源:login.py


示例19: PrettyTab

class PrettyTab(Composite):

    def __init__(self, text, imageUrl):

        DecoratorPanel.__init__(self, DecoratorPanel.DECORATE_ALL)
        p = HorizontalPanel()
        p.setSpacing(3)
        self.img = Image(imageUrl)
        self.txt = HTML(text)
        p.add(self.img)
        p.add(self.txt)

        self.add(p)

    def addClickListener(self, listener):

        self.img.addClickListener(listener)
        self.txt.addClickListener(listener)
开发者ID:anandology,项目名称:pyjamas,代码行数:18,代码来源:index.py


示例20: notLoggedIn

 def notLoggedIn(self):
     if self.oauthCookie:
         _deleteCookie()
         self.oauthCookie = None
     self.clear()
     self.loggedIn = False
     self.screenname = None
     self.friendsIds = None
     loginImage = Image('login.png', StyleName='login-image')
     loginImage.addMouseListener(self)
     self.setWidget(0, 0, loginImage)
     why = Button(WHY_BUTTON_TEXT, self, StyleName='why-button')
     self.setWidget(0, 1, why)
     self.instructions = HTML(WHY_TEXT,
                              StyleName='instructions-popup',
                              HorizontalAlignment=HasAlignment.ALIGN_LEFT)
     self.popup = tickerytab.InstructionBox(
         self.__class__.__name__, self.instructions)
     self.popup.setText(WHY_TITLE)
开发者ID:fluidinfo,项目名称:Tickery,代码行数:19,代码来源:login.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python Label.Label类代码示例发布时间:2022-05-25
下一篇:
Python Hyperlink.Hyperlink类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap