本文整理了Java中org.eclipse.swt.widgets.Shell.setAlpha()
方法的一些代码示例,展示了Shell.setAlpha()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.setAlpha()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:setAlpha
[英]Sets the receiver's alpha value.
This operation may not be available on some platforms.
[中]设置接收器的alpha值。
在某些平台上,此操作可能不可用。
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void mouseUp(MouseEvent e) {
moving = false;
if ( old_alpha != 255 ){
splash.setAlpha( old_alpha );
}
}
代码示例来源:origin: org.eclipse.mylyn.commons/screenshots
public void run() {
if (setAlpha) {
shell.setAlpha(getLastAlpha());
}
}
});
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void mouseDown(MouseEvent e) {
xPressed = e.x;
yPressed = e.y;
moving = true;
old_alpha = splash.getAlpha();
if ( old_alpha != 255 ){
splash.setAlpha( 255 );
}
//System.out.println("Position : " + xPressed + " , " + yPressed);
}
代码示例来源:origin: org.eclipse.mylyn.commons/screenshots
public void run() {
if (stopped) {
return;
}
if (shell.isDisposed()) {
stopped = true;
return;
}
shell.setAlpha(currentAlpha);
if (fadeListener != null) {
fadeListener.faded(shell, currentAlpha);
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public void renderStep(AnimationEngine engine) {
getAnimationShell().setAlpha((int) (255 - (engine.amount()*255)));
}
代码示例来源:origin: 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(new PaintListener() {
public void paintControl(PaintEvent e) {
e.gc.setForeground(blue);
e.gc.setBackground(blue);
for (Adornment adornment : adornments) {
adornment.drawAdornment(e.gc);
}
}
});
}
代码示例来源:origin: BiglySoftware/BiglyBT
splash.setAlpha( alpha );
代码示例来源:origin: stackoverflow.com
shell.setAlpha(0);
代码示例来源: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: com.diffplug.durian/durian-swt
shell.setAlpha(alpha);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
private void createFeedback() {
dragShell = new Shell(SWT.NO_TRIM | SWT.NO_BACKGROUND);
dragShell.setAlpha(175);
ToolBar dragTB = new ToolBar(dragShell, SWT.RIGHT);
ToolItem newTI = new ToolItem(dragTB, SWT.RADIO);
newTI.setText(dragItem.getText());
newTI.setImage(dragItem.getImage());
dragTB.pack();
dragShell.pack();
dragShell.setVisible(true);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public void initialize(AnimationEngine engine) {
Rectangle psRect = getBaseShell().getBounds();
getAnimationShell().setBounds(psRect);
// Capture the background image
Display display = getBaseShell().getDisplay();
backingStore = new Image(display, psRect);
GC gc = new GC(display);
// gc.copyArea(backingStore, psRect.x, psRect.y);
gc.copyArea(backingStore, psRect.x, psRect.y);
gc.dispose();
getAnimationShell().setAlpha(254);
getAnimationShell().setBackgroundImage(backingStore);
getAnimationShell().setVisible(true);
}
代码示例来源:origin: org.xworker/xworker_swt
shell.setAlpha(255);
shell.layout();
代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt
public void setDragHostBounds(Rectangle displayRect) {
if (dragHost == null)
return;
dragHostBounds = displayRect;
// Re-attach the drag host to the cursor
if (dragHostBounds == null) {
dragHost.setSize(initialHostSize);
setDragHost(dragHost, offsetX, offsetY);
return;
}
// dragHost.setVisible(false);
dragHost.setAlpha(200);
dragHost.setBounds(dragHostBounds);
// punch a 'hole' where the cursor *is*
Point cursorLoc = display.getCursorLocation();
cursorLoc = display.map(null, dragHost, cursorLoc);
Region rgn = dragHost.getRegion();
Rectangle bounds = dragHost.getBounds();
rgn.add(0, 0, bounds.width, bounds.height);
rgn.subtract(cursorLoc.x, cursorLoc.y, 1, 1);
display.update();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt
public void setDragHostBounds(Rectangle displayRect) {
if (dragHost == null) {
return;
}
dragHostBounds = displayRect;
// Re-attach the drag host to the cursor
if (dragHostBounds == null) {
dragHost.setSize(initialHostSize);
setDragHost(dragHost, offsetX, offsetY);
return;
}
// dragHost.setVisible(false);
dragHost.setAlpha(200);
dragHost.setBounds(dragHostBounds);
// punch a 'hole' where the cursor *is*
Point cursorLoc = display.getCursorLocation();
cursorLoc = display.map(null, dragHost, cursorLoc);
Region rgn = dragHost.getRegion();
Rectangle bounds = dragHost.getBounds();
rgn.add(0, 0, bounds.width, bounds.height);
rgn.subtract(cursorLoc.x, cursorLoc.y, 1, 1);
display.update();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt
overlayFrame.setData(DragAndDropUtil.IGNORE_AS_DROP_TARGET, Boolean.TRUE);
overlayFrame.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN));
overlayFrame.setAlpha(150);
代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt
overlayFrame = new Shell(getDragShell(), SWT.NO_TRIM);
overlayFrame.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN));
overlayFrame.setAlpha(150);
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt
dragHost.setBackground(parentShell.getDisplay().getSystemColor(SWT.COLOR_WHITE));
dragHost.setLayout(new FillLayout());
dragHost.setAlpha(120);
Region shellRgn = new Region(dragHost.getDisplay());
dragHost.setRegion(shellRgn);
代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt
dragHost.setBackground(parentShell.getDisplay().getSystemColor(SWT.COLOR_WHITE));
dragHost.setLayout(new FillLayout());
dragHost.setAlpha(120);
Region shellRgn = new Region(dragHost.getDisplay());
dragHost.setRegion(shellRgn);
代码示例来源:origin: BiglySoftware/BiglyBT
shell.setAlpha(230);
内容来源于网络,如有侵权,请联系作者删除!