本文整理了Java中org.eclipse.swt.widgets.Shell.setBackground()
方法的一些代码示例,展示了Shell.setBackground()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.setBackground()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:setBackground
暂无
代码示例来源:origin: pentaho/pentaho-kettle
@Override
protected void configureShell( Shell shell ) {
super.configureShell( shell );
shell.setBackground( shell.getDisplay().getSystemColor( DIALOG_COLOR ) );
shell.setBackgroundMode( SWT.INHERIT_FORCE );
}
};
代码示例来源:origin: stackoverflow.com
if(((e.stateMask & SWT.CTRL) == SWT.CTRL) && (e.keyCode == 'f'))
shell.setBackground(orig);
System.out.println("Key up !!");
if(((e.stateMask & SWT.CTRL) == SWT.CTRL) && (e.keyCode == 'f'))
shell.setBackground(green);
System.out.println("Key down !!");
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
@Override
public void setBackgroundColor(Color background) {
mShell.setBackground(background);
}
代码示例来源:origin: pentaho/pentaho-kettle
@Override
protected void configureShell( Shell shell ) {
super.configureShell( shell );
shell.setBackground( shell.getDisplay().getSystemColor( DIALOG_COLOR ) );
shell.setBackgroundMode( SWT.INHERIT_FORCE );
}
};
代码示例来源:origin: org.eclipse.mylyn.commons/workbench
@Override
protected Control createContents(Composite parent) {
getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
Control createDialogArea = createDialogArea(parent);
return createDialogArea;
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Overridden to make the shell background white.
*
* @param shell
*/
@Override
protected void configureShell( Shell shell ) {
super.configureShell( shell );
shell.setBackground( shell.getDisplay().getSystemColor( SWT.COLOR_WHITE ) );
shell.setBackgroundMode( SWT.INHERIT_FORCE );
}
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
/**
* Initializes a new instance.
*
* @param parent the parent
* @param contentHandler the content handler
*/
public CustomInformationControl(Shell parent,
ICustomInformationControlContentHandler contentHandler) {
mContentHandler = contentHandler;
mShell = new Shell(parent, SWT.NO_FOCUS | SWT.ON_TOP);
mShell.setLayout(new FillLayout());
Display display = mShell.getDisplay();
mShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
}
代码示例来源:origin: be.yildiz-games/module-window-swt
public void setBackground(final Color background) {
this.shell.setBackgroundMode(SWT.INHERIT_DEFAULT);
this.shell.setBackground(new org.eclipse.swt.graphics.Color(this.shell.getDisplay(), background.red, background.green, background.blue));
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.runtime
@Override
protected Control createContents(Composite parent) {
getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
initializeBounds();
return createDialogArea(parent);
}
代码示例来源:origin: stackoverflow.com
public static void main(String[] args)
{
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
shell.setText("StackOverflow");
shell.setBackground(display.getSystemColor(SWT.COLOR_BLUE));
shell.setBackgroundMode(SWT.INHERIT_FORCE);
new Button(shell, SWT.PUSH).setText("Button");
new Label(shell, SWT.NONE).setText("Label");
shell.pack();
shell.open();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.runtime
@Override
protected Control createContents(Composite parent) {
getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
initializeBounds();
return createDialogArea(parent);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public void initialize(AnimationEngine engine) {
Color color = getAnimationShell().getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW);
getAnimationShell().setBackground(color);
// Ensure that the background won't show on the initial display
shellRegion = new Region(getAnimationShell().getDisplay());
getAnimationShell().setRegion(shellRegion);
}
代码示例来源:origin: pentaho/big-data-plugin
public void create() {
super.create();
getShell().setBackground( GUIResource.getInstance().getColorWhite() );
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
Hover(Shell parent) {
final Display display = parent.getDisplay();
hoverShell = new Shell(parent, SWT.NO_TRIM | SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
hoverShell.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
hoverShell.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
hoverShell.addPaintListener(new PaintListener() {
public void paintControl(PaintEvent pe) {
pe.gc.drawText(text, hm, hm);
if(!CARBON) {
pe.gc.drawPolygon(getPolygon(true));
}
}
});
hoverShell.addMouseListener(new MouseAdapter() {
public void mouseDown(MouseEvent e) {
hideHover();
}
});
}
代码示例来源:origin: org.eclipse.scout.sdk.s2e/org.eclipse.scout.sdk.s2e.nls
/**
* @param parent
*/
public TableTextEditor(TableCursor parent, int style) {
m_shell = new Shell(parent.getShell(), SWT.TOOL);
m_shell.setBounds(computeBounds(parent, style));
m_shell.setBackground(parent.getShell().getDisplay().getSystemColor(SWT.COLOR_GREEN));
FillLayout layout = new FillLayout();
layout.marginHeight = BORDER_WIDTH;
layout.marginWidth = BORDER_WIDTH;
m_shell.setLayout(layout);
m_text = new Text(m_shell, style);
m_text.setBackground(m_text.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
}
代码示例来源:origin: openaudible/openaudible
/**
* Create the Shell and Label for the fake tooltip showing URLs
*/
private void createFakeToolTip() {
fakeToolTip = new Shell(GUI.shell, SWT.ON_TOP);
fakeToolTip.setLayout(LayoutShop.createFillLayout(2, 2));
fakeToolTip.setForeground(GUI.display
.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
fakeToolTip.setBackground(GUI.display
.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
fakeToolTipLabel = new Label(fakeToolTip, SWT.NONE);
fakeToolTipLabel.setForeground(GUI.display
.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
fakeToolTipLabel.setBackground(GUI.display
.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt
public Overlay(Shell shell) {
baseShell = shell;
Rectangle cr = baseShell.getClientArea();
Rectangle trim = baseShell.computeTrim(cr.x, cr.y, cr.width, cr.height);
offsetX = -trim.x;
offsetY = -trim.y;
overlayShell = new Shell(baseShell, SWT.NO_TRIM | SWT.ON_TOP);
overlayShell.setBounds(baseShell.getBounds());
overlayShell.setBackground(baseShell.getDisplay().getSystemColor(
SWT.COLOR_DARK_GREEN));
overlayShell.setAlpha(128);
blue = new Color(baseShell.getDisplay(), 0, 0, 128);
overlayShell.addPaintListener(e -> {
e.gc.setForeground(blue);
e.gc.setBackground(blue);
for (Adornment adornment : adornments) {
adornment.drawAdornment(e.gc);
}
});
}
代码示例来源:origin: openaudible/openaudible
protected void initializeBounds() {
super.initializeBounds();
getShell().setBackground(bgColor);
getShell().addListener(SWT.MouseDown, this);
Rectangle r = GUI.shell.getBounds();
getShell().setLocation(r.x + 160, r.y + 160);
getShell().addListener(SWT.Deactivate, this);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
/**
* Creates the context information popup. This is the tooltip like overlay window.
*/
private void createContextInfoPopup() {
if (Helper2.okToUse(fContextInfoPopup))
return;
Control control= fViewer.getTextWidget();
Display display= control.getDisplay();
fContextInfoPopup= new Shell(control.getShell(), SWT.NO_TRIM | SWT.ON_TOP);
fContextInfoPopup.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
fContextInfoText= new StyledText(fContextInfoPopup, SWT.MULTI | SWT.READ_ONLY);
Color c= fContentAssistant.getContextInformationPopupBackground();
if (c == null)
c= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
fContextInfoText.setBackground(c);
c= fContentAssistant.getContextInformationPopupForeground();
if (c == null)
c= display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
fContextInfoText.setForeground(c);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
/**
* Creates the context information popup. This is the tooltip like overlay window.
*/
private void createContextInfoPopup() {
if (Helper2.okToUse(fContextInfoPopup))
return;
Control control= fViewer.getTextWidget();
Display display= control.getDisplay();
fContextInfoPopup= new Shell(control.getShell(), SWT.NO_TRIM | SWT.ON_TOP);
fContextInfoPopup.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
fContextInfoText= new StyledText(fContextInfoPopup, SWT.MULTI | SWT.READ_ONLY);
Color c= fContentAssistant.getContextInformationPopupBackground();
if (c == null)
c= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND);
fContextInfoText.setBackground(c);
c= fContentAssistant.getContextInformationPopupForeground();
if (c == null)
c= display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
fContextInfoText.setForeground(c);
}
内容来源于网络,如有侵权,请联系作者删除!