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


Python Display.getDefault方法代码示例

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


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

示例1: showDialogBox

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
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,代码行数:17,代码来源:generateBehaviorModels.py

示例2: valueChanged

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
 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,代码行数:19,代码来源:Initialise.py

示例3: select_scn_file

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
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,代码行数:14,代码来源:import_scn.py

示例4: run

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
 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,代码行数:38,代码来源:3_TableScan_UpdateCurrentScanInfo.py

示例5: __init__

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
 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,代码行数:17,代码来源:AdvancedSearch.py

示例6: run

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
 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,代码行数:26,代码来源:3_TableScan_UpdateCurrentScanInfo.py

示例7: __init__

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
  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,代码行数:18,代码来源:oclscribe_interface.py

示例8: __init__

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
 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,代码行数:21,代码来源:misc.py

示例9: runInUi

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
 def runInUi(callable):
     '''
     @param callable: the callable that will be run in the UI
     '''
     Display.getDefault().asyncExec(RunInUi(callable))
开发者ID:ABAtanasov,项目名称:Sparse-Grids,代码行数:7,代码来源:pyedit_pythontidy.py

示例10: exec

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
def exec(r):
	display = Display.getDefault()	
	display.syncExec(r)
	return None
开发者ID:kaihumuc,项目名称:openhrp,代码行数:6,代码来源:syncExec.py

示例11: Shell

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
          PopupDialog.__init__(self, 
                               Shell(),
                               PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE, 
                               True, False, True, False, 
                               'Details about \'' + advice.getName() + '\'', 'Juniper IDE')

      def createDialogArea(self, parent):
          composite = self.super__createDialogArea(parent)

          glayout = GridLayout(1, False)
          composite.setLayout(glayout)

          data = GridData(SWT.FILL, SWT.FILL, True, True);
          data.widthHint = 800;
          data.heightHint = 350;
          composite.setLayoutData(data);

          browser = Browser(composite, SWT.NONE)
          browser.setUrl(File(output.name).toURI().toString())
          browser.setLayoutData(GridData(SWT.FILL, SWT.FILL, True, True));

          return composite

class ShowDialog(Runnable):
      def __init__(self, advice):
          self.advice = advice
      def run(self):
          AlertDialog(self.advice).open()

Display.getDefault().syncExec(ShowDialog(advice))
开发者ID:juniper-project,项目名称:modelling-environment,代码行数:32,代码来源:showAdvice.py

示例12: run

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
	    def run(self):
			m = MessageBox(Display.getDefault().getActiveShell(), SWT.ICON_WARNING|SWT.OK)
			m.setText(text)
			m.setMessage(message)
			m.open()
开发者ID:juniper-project,项目名称:modelling-environment,代码行数:7,代码来源:generateBehaviorModels.py

示例13: runInUi

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
    def runInUi(callAble):
        """@param callable: the callable that will be run in the UI."""

        Display.getDefault().asyncExec(RunInUi(callAble))
开发者ID:JohnMofor,项目名称:toySearchEngine,代码行数:6,代码来源:pyedit_pythontidy.py

示例14: RunGeneration

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
		scp.set('todir', '[email protected]'+ip+':${deployment.path}')
		scp.set('keyfile', '${accesspoint.keyfile}')
		scp.set('forwardingHost', '${accesspoint.address}')
		scp.set('forwardingUserName', '${accesspoint.username}')
		scp.set('passphrase', '')
		scp.set('trust', 'on')
		scp.set('verbose', 'on')

f.write('<?xml version="1.0"?>' + ET.tostring(project, encoding='utf-8'))
f.close()

# Make Jdesigner re-generate Java files
from org.modelio.api.modelio import Modelio
from org.modelio.module.javadesigner.api import JavaDesignerParameters
config.setParameterValue(JavaDesignerParameters.GENDOCPATH, "$(Project)/code/"+projectName+"/doc")
config.setParameterValue(JavaDesignerParameters.GENERATIONPATH, "$(Project)/code/"+projectName+"/src")
config.setParameterValue(JavaDesignerParameters.JARFILEPATH, "$(Project)/code/"+projectName+"/src")
config.setParameterValue(JavaDesignerParameters.JAVAHGENERATIONPATH, "$(Project)/code/"+projectName+"/src")

from org.eclipse.swt.widgets import Display
from java.lang import Runnable

class RunGeneration(Runnable):
    def __init__(self):
        pass

    def run(self):
    	jdesigner.generate(swPlat, True)

Display.getDefault().asyncExec(RunGeneration())
开发者ID:juniper-project,项目名称:modelling-environment,代码行数:32,代码来源:updateAndGenerateCode.py

示例15: applyModifier

# 需要导入模块: from org.eclipse.swt.widgets import Display [as 别名]
# 或者: from org.eclipse.swt.widgets.Display import getDefault [as 别名]
 def applyModifier(self, modifier, color):
     try:
         return modifier(color)
     except:
         colorToUse = Color(Display.getDefault(), color.getRed(), color.getGreen(), color.getBlue())
         return modifier(colorToUse)
开发者ID:gbtami,项目名称:storytext,代码行数:8,代码来源:describer.py


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