@Override public void mouseUp(MouseEvent e) { moving = false; if ( old_alpha != 255 ){ splash.setAlpha( old_alpha ); } }
public void run() { if (setAlpha) { shell.setAlpha(getLastAlpha()); } } });
@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); }
public void run() { if (stopped) { return; } if (shell.isDisposed()) { stopped = true; return; } shell.setAlpha(currentAlpha); if (fadeListener != null) { fadeListener.faded(shell, currentAlpha); } } });
@Override public void renderStep(AnimationEngine engine) { getAnimationShell().setAlpha((int) (255 - (engine.amount()*255))); }
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); } } }); }
splash.setAlpha( alpha );
shell.setAlpha(0);
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); } }); }
shell.setAlpha(alpha);
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); }
@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); }
shell.setAlpha(255); shell.layout();
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(); }
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(); }
overlayFrame.setData(DragAndDropUtil.IGNORE_AS_DROP_TARGET, Boolean.TRUE); overlayFrame.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN)); overlayFrame.setAlpha(150);
overlayFrame = new Shell(getDragShell(), SWT.NO_TRIM); overlayFrame.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GREEN)); overlayFrame.setAlpha(150);
dragHost.setBackground(parentShell.getDisplay().getSystemColor(SWT.COLOR_WHITE)); dragHost.setLayout(new FillLayout()); dragHost.setAlpha(120); Region shellRgn = new Region(dragHost.getDisplay()); dragHost.setRegion(shellRgn);
dragHost.setBackground(parentShell.getDisplay().getSystemColor(SWT.COLOR_WHITE)); dragHost.setLayout(new FillLayout()); dragHost.setAlpha(120); Region shellRgn = new Region(dragHost.getDisplay()); dragHost.setRegion(shellRgn);
shell.setAlpha(230);