Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 31767 Details for
Bug 29994
Image background Composite / Transparent widget backgrounds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
comment 23-snippet
Snippet214.java (text/plain), 2.41 KB, created by
Michael Chervil
on 2005-12-14 13:10:23 EST
(
hide
)
Description:
comment 23-snippet
Filename:
MIME Type:
Creator:
Michael Chervil
Created:
2005-12-14 13:10:23 EST
Size:
2.41 KB
patch
obsolete
>import org.eclipse.swt.SWT; >import org.eclipse.swt.graphics.GC; >import org.eclipse.swt.graphics.Image; >import org.eclipse.swt.graphics.ImageData; >import org.eclipse.swt.graphics.Rectangle; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.layout.RowLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Event; >import org.eclipse.swt.widgets.Group; >import org.eclipse.swt.widgets.Listener; >import org.eclipse.swt.widgets.Shell; >import org.eclipse.swt.widgets.ToolBar; >import org.eclipse.swt.widgets.ToolItem; > >public class Snippet214 { > > static Image oldImage; > > public static void main( String[] args ) { > final Display display = new Display(); > final Shell shell = new Shell(display); > shell.setBackgroundMode(SWT.INHERIT_FORCE); > FillLayout layout1 = new FillLayout(SWT.VERTICAL); > layout1.marginWidth = layout1.marginHeight = 10; > shell.setLayout(layout1); > Group group = new Group(shell, SWT.NONE); > group.setText("Group "); > RowLayout layout2 = new RowLayout(SWT.VERTICAL); > layout2.marginWidth = layout2.marginHeight = layout2.spacing = 10; > group.setLayout(layout2); > > ImageData data = new ImageData(Snippet214.class.getClassLoader().getResourceAsStream("ok.png")); > Image IMAGE = new Image(display, data); > ToolBar okToolbar = new ToolBar(group, SWT.FLAT | SWT.HORIZONTAL); > ToolItem ok = new ToolItem(okToolbar, SWT.PUSH); > ok.setImage(IMAGE); > > shell.addListener(SWT.Resize, new Listener() { > public void handleEvent( Event event ) { > Rectangle rect = shell.getClientArea (); > Image newImage = new Image (display, Math.max (1, rect.width), 1); > GC gc = new GC (newImage); > gc.setForeground (display.getSystemColor (SWT.COLOR_WHITE)); > gc.setBackground (display.getSystemColor (SWT.COLOR_BLUE)); > gc.fillGradientRectangle (rect.x, rect.y, rect.width, 1, false); > gc.dispose (); > shell.setBackgroundImage (newImage); > if (oldImage != null) oldImage.dispose (); > oldImage = newImage; > } > }); > shell.pack(); > shell.open(); > while ( !shell.isDisposed() ) { > if ( !display.readAndDispatch() ) > display.sleep(); > } > if ( oldImage != null ) > oldImage.dispose(); > display.dispose(); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 29994
: 31767 |
31768