splash.addPaintListener( new PaintListener() { public void paintControl( PaintEvent e ) { StringBuilder sb = new StringBuilder();
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(); } }); }
shell.addPaintListener(painter); final Label l = new Label(shell, SWT.NONE); l.setBounds(10, 10, 60, 40);
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); } } }); }
shell.addPaintListener(e -> e.gc.drawString(ControlExample.getResourceString("PopupMenuHere"), 20, 20)); shell.open (); shellCount++;
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(pe -> { pe.gc.drawString(text, hm, hm); if (!MAC) { pe.gc.drawPolygon(getPolygon(true)); } }); hoverShell.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { hideHover(); } }); }
public Shell open (Display display) { final Color red = new Color(display, 0xFF, 0, 0); final Shell shell = new Shell (display); shell.addPaintListener(event -> { GC gc = event.gc; gc.setForeground(red); Rectangle rect = shell.getClientArea(); gc.drawRectangle(rect.x + 10, rect.y + 10, rect.width - 20, rect.height - 20); gc.drawString(resHello.getString("Hello_world"), rect.x + 20, rect.y + 20); }); shell.addDisposeListener (e -> red.dispose()); shell.open (); return shell; } }
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(pe -> { pe.gc.drawText(text, hm, hm); if (!MAC) { pe.gc.drawPolygon(getPolygon(true)); } }); hoverShell.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { hideHover(); } }); }
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(pe -> { pe.gc.drawText(text, hm, hm); if (!MAC) { pe.gc.drawPolygon(getPolygon(true)); } }); hoverShell.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { hideHover(); } }); }
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); } }); }
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(pe -> { pe.gc.drawString(text, hm, hm); if (!MAC) { pe.gc.drawPolygon(getPolygon(true)); } }); hoverShell.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { hideHover(); } }); }
fPopup.addPaintListener(new PaintListener() { public void paintControl(PaintEvent pe) { pe.gc.drawPolygon(getPolygon(true));
fPopup.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent pe) {
fPopup.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent pe) {
popup.addPaintListener(new PaintListener() { public void paintControl(PaintEvent pe) { pe.gc.drawPolygon(getPolygon(true));
stylingEngine.style(overlayFrame); overlayFrame.addPaintListener(e -> { for (int i = 0; i < images.size(); i++) { Image image = images.get(i);
shell.addPaintListener(new PaintListener() {
shell.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) {
stylingEngine.style(overlayFrame); overlayFrame.addPaintListener(new PaintListener() { public void paintControl(PaintEvent e) { for (int i = 0; i < images.size(); i++) {