本文整理汇总了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())
示例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__
示例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()
示例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)
示例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()
示例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)
示例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 ()
示例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()
示例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))
示例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
示例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))
示例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()
示例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))
示例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())
示例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)