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


Python widgets.Display类代码示例

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


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

示例1: getImageName

    def getImageName(self, image):
        name = self.imageToName.get(image)
        if name is not None:
            return name

        data = image.getImageData()
        hasExcessData = data.width * data.depth / 8 < data.bytesPerLine
        imageDict = self.storedImages.get((data.width, data.height), {})
        for name, imgData in imageDict.items():
            if self.imageDataMatches(data, imgData, hasExcessData):
                baseName = os.path.basename(name)
                self.imageToName[image] = baseName             
                return baseName
        for iconId, iconName in self.systemIcons:
            iconImage = Display.getCurrent().getSystemImage(iconId)
            if iconImage and self.imageDataMatches(data, iconImage.getImageData(), hasExcessData):
                return "system_" + iconName
        for img, imgName in self.renderedImages:
            if self.imageDataMatches(data, img.getImageData(), hasExcessData):
                return "rendered_" + imgName
        # Last chance, see if the image has been greyed out 
        for name, imgData in imageDict.items():
            greyedImg = Image(Display.getCurrent(), Image(Display.getCurrent(), imgData), SWT.IMAGE_GRAY)
            greyedData = greyedImg.getImageData()
            hasGreyedExcessData = greyedData.width * greyedData.depth / 8 < greyedData.bytesPerLine
            if self.imageDataMatches(data, greyedData, hasGreyedExcessData):
                greyedName =  os.path.basename(name) + "', 'greyed out"
                self.imageToName[image] = greyedName             
                return greyedName
开发者ID:gbtami,项目名称:storytext,代码行数:29,代码来源:describer.py

示例2: _getForeground

 def _getForeground(data):
   if isinstance(data,ElementInfo):
     return Color(Display.getCurrent(),0,0,150)
   elif isinstance(data,MetaFeatureSlot):
     mv = data.getModelValue()
     if mv.isElement() or mv.isElementList(): 
       return Color(Display.getCurrent(),0,100,0)
     else:
       return Color(Display.getCurrent(),0,180,0)      
开发者ID:escribis,项目名称:.modelio,代码行数:9,代码来源:introspection.py

示例3: showDialogBox

def showDialogBox(text, message):      	 
	from org.eclipse.swt.widgets import Display
	from java.lang import Runnable
	
	class ShowDialogBox(Runnable):
	    def __init__(self):
	        pass
	
	    def run(self):
			m = MessageBox(Display.getDefault().getActiveShell(), SWT.ICON_WARNING|SWT.OK)
			m.setText(text)
			m.setMessage(message)
			m.open()
	
	Display.getDefault().syncExec(ShowDialogBox())
开发者ID:juniper-project,项目名称:modelling-environment,代码行数:15,代码来源:generateBehaviorModels.py

示例4: getImageFromName

 def getImageFromName(self,name):
   if name not in self.imageMap:
     try:
       image = Image(Display.getCurrent(),os.path.join(self.resourcePath,name+self.extension))
     except:
       image = None
     self.imageMap[name] = image
   return self.imageMap[name]
开发者ID:escribis,项目名称:.modelio,代码行数:8,代码来源:misc.py

示例5: valueChanged

 def valueChanged(self, controller, newValue):
     global __file_to_add__
     newCount = int(newValue.getStringData());
     if newCount != self.saveCount:
         self.saveCount = newCount;
         try:
             checkFile = File(__file_name_node__.getValue().getStringData());
             checkFile = File(__data_folder__ + "/" + checkFile.getName());
             __file_to_add__ = checkFile.getAbsolutePath();
             if not checkFile.exists():
                 print "The target file :" + __file_to_add__ + " can not be found";
                 return
             runnable = __Display_Runnable__()
             runnable.run = add_dataset
             Display.getDefault().asyncExec(runnable)
         except: 
             print 'failed to add dataset ' + __file_to_add__
开发者ID:Gumtree,项目名称:Pelican_scripts,代码行数:17,代码来源:Initialise.py

示例6: hardwareModelIsMissingMessageBox

def hardwareModelIsMissingMessageBox(programs):
	for program in programs :
		if not program.getRepresenting():
			msg = MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_WARNING|SWT.OK)
			msg.setText("Update or generate code")
			msg.setMessage("Warn : generate hardware model please.")
			msg.open()
			return False
	return True
开发者ID:juniper-project,项目名称:modelling-environment,代码行数:9,代码来源:updateAndGenerateCode.py

示例7: select_scn_file

def select_scn_file():
    from org.eclipse.swt.widgets import Display, FileDialog, Shell
    from org.eclipse.swt import SWT

    display = Display.getDefault().getActiveShell()
    shell = Shell(display)

    fd = FileDialog(shell, SWT.OPEN)
    fd.setText('Open')
    filterExt = ['*.scn', '*.*']
    fd.setFilterExtensions(filterExt)
    return fd.open()
开发者ID:avertj,项目名称:fr.ujf.idm.modelio.ClassScribe,代码行数:12,代码来源:import_scn.py

示例8: run

 def run(self):
     while display.isActive():
         scan_id = long(display.getVar("LatestPointScanID"))
         if scan_id > 0:
             scanInfo = client.getScanInfo(scan_id)
             statusLabel.setPropertyValue("text", scanInfo.getState().toString())
             if scanInfo.getState().isActive():
                 scanNameLabel.setPropertyValue("text", scanInfo.getName())
                 commandLabel.setPropertyValue("text", scanInfo.getCurrentCommand())
                 progressBar.setPropertyValue("pv_value", scanInfo.getPercentage()/100.0)
                 # Mark scanned points as green 
                 for i in range(table.getRowCount()):
                     xpos=float(table.getCellText(i, 1))
                     ypos=float(table.getCellText(i, 2))
                     if (xpos == PVUtil.getDouble(pvs[1]) and ypos==PVUtil.getDouble(pvs[2]) 
                         and scanInfo.getPercentage() >= i*100.0/table.getRowCount()): #To make sure the matched position is set from this scan                              
                         Display.getDefault().asyncExec(SetRowColor(i, ColorFontUtil.GREEN))
             elif scanInfo.getState().isDone():
                  display.setVar("LatestPointScanID", -1)
         else:
             scanNameLabel.setPropertyValue("text", "None")
             commandLabel.setPropertyValue("text", "")
             progressBar.setPropertyValue("pv_value", 0)
         Thread.sleep(1000)
开发者ID:ATNF,项目名称:cs-studio,代码行数:24,代码来源:3_TableScan_UpdateCurrentScanInfo.py

示例9: run

 def run(self):
     while display.isActive():
         scanInfos = client.server.getScanInfos()
         findActive = False
         markedDone = False
         for scanInfo in scanInfos:
             if scanInfo.getId() == long(display.getVar("LatestPointScanID")):
                 statusLabel.setPropertyValue("text", scanInfo.getState().toString())
             if scanInfo.getState().isDone():
                 #mark table to dark gray if it is done.
                 if scanInfo.getId() == long(display.getVar("LatestPointScanID")) and not markedDone :
                     for i in range(table.getRowCount()):
                         Display.getDefault().asyncExec(SetRowColor(i, ColorFontUtil.DARK_GRAY))
                     markedDone=True 
                 continue
             if scanInfo.getState().isActive():
                 scanNameLabel.setPropertyValue("text", scanInfo.getName())
                 commandLabel.setPropertyValue("text", scanInfo.getCurrentCommand())
                 progressBar.setPropertyValue("pv_value", scanInfo.getPercentage()/100.0)
                 #Mark scanned points as green 
                 if scanInfo.getId() == long(display.getVar("LatestPointScanID")):
                     markedDone=False
                     for i in range(table.getRowCount()):
                         xpos=float(table.getCellText(i, 1))
                         ypos=float(table.getCellText(i, 2))
                         if (xpos == PVUtil.getDouble(pvs[1]) and ypos==PVUtil.getDouble(pvs[2]) 
                             and scanInfo.getPercentage() >= i*100.0/table.getRowCount()): #To make sure the matched position is set from this scan                              
                             Display.getDefault().asyncExec(SetRowColor(i, ColorFontUtil.GREEN))                            
                
                 findActive=True   
                 
         if not findActive:
             scanNameLabel.setPropertyValue("text", "None")
             commandLabel.setPropertyValue("text", "")
             progressBar.setPropertyValue("pv_value", 0)
         Thread.sleep(200)
开发者ID:Desy-extern,项目名称:cs-studio,代码行数:36,代码来源:3_TableScan_UpdateCurrentScanInfo.py

示例10: __init__

 def __init__(self):
   childW = 500
   childH = 400
   parent = Display.getDefault().getActiveShell()
   child = Shell(parent, SWT.CLOSE | SWT.RESIZE)
   child.setMinimumSize(childW, childH)
   child.setText("Advanced Search")
   self._createContent(child)
   parentW = parent.getBounds().width
   parentH = parent.getBounds().height
   parentX = parent.getBounds().x
   parentY = parent.getBounds().y
   child.setLocation((parentW-childW)/2+parentX, (parentH-childH)/2+parentY)
   child.setSize(childW, childH)
   child.open()
开发者ID:escribis,项目名称:macros,代码行数:15,代码来源:AdvancedSearch.py

示例11: __init__

  def __init__(self, title= None, toDisplay= None):


    parentShell = Display.getDefault().getActiveShell()
    self.window = Shell(parentShell, SWT.CLOSE | SWT.RESIZE)
    self.window.setText(title)
    self.window.setLayout(FillLayout())
    self.window.setSize (self.window.computeSize(1400, 500))
    self.text = Browser(self.window, SWT.NONE)
    self.text.setText( \
              "<html><header><style>" +
              "<!--.tab { margin-left: 40px;} .tab2 { margin-left: 80px; }" + 
              " .tab3 { margin-left: 120px; }.tab4 { margin-left: 160px; }-->" +
              "</style></header><body><div style=\"overflow: auto;\">" + 
              toDisplay + "</div></body></html>")
    self.window.open ()
开发者ID:ArnaudPanaiotis,项目名称:ModelioScribes,代码行数:16,代码来源:oclscribe_interface.py

示例12: go

def go():
    global display
    
    # global variable window is org.eclipse.ui.internal.WorkbenchWindow
    open_monkey_console()

    display = Display.getCurrent()
    
    runnable = MyRunnable()
    if not runnable.prepare():
        return
    
    create_progress_monitor()
        
    progress_monitor_dialog = ProgressMonitorDialog(window.getShell())
    progress_monitor_dialog.run(True, True, runnable);
    
    window.updateActionBars()
开发者ID:miohtama,项目名称:mfabrik.scanner,代码行数:18,代码来源:import_src.py

示例13: __init__

 def __init__(self, url=None, html=None,title="information",width=800,height=800,labeltext=""):      
   parent = Display.getDefault().getActiveShell()
   self.window = Shell(parent, SWT.CLOSE | SWT.RESIZE)
   # give minimum size, location and size
   self.window.setMinimumSize(width, height)
   parentBounds = parent.getBounds()
   self.window.setLocation( \
     (parentBounds.width-width)/2+parentBounds.x, \
     (parentBounds.height-height)/2+parentBounds.y )
   self.window.setSize(width, height)
   # layout
   gridLayout = GridLayout(1, 1)
   self.window.setLayout(gridLayout)
   self.window.setText(title)
   self._createLabel(labeltext)
   self._createBrowser(url=url,html=html)
   self._createOkButton()
   self._listenSelection()
   self.window.open()
开发者ID:escribis,项目名称:.modelio,代码行数:19,代码来源:misc.py

示例14: runInUi

 def runInUi(callable):
     '''
     @param callable: the callable that will be run in the UI
     '''
     Display.getDefault().asyncExec(RunInUi(callable))
开发者ID:ABAtanasov,项目名称:Sparse-Grids,代码行数:5,代码来源:pyedit_pythontidy.py

示例15: exec

def exec(r):
	display = Display.getDefault()	
	display.syncExec(r)
	return None
开发者ID:kaihumuc,项目名称:openhrp,代码行数:4,代码来源:syncExec.py


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