]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.swt.minidesktop/src/org/argeo/minidesktop/MiniDesktopImages.java
1 package org
.argeo
.minidesktop
;
3 import java
.io
.IOException
;
4 import java
.io
.InputStream
;
6 import org
.eclipse
.swt
.SWTException
;
7 import org
.eclipse
.swt
.graphics
.Image
;
8 import org
.eclipse
.swt
.widgets
.Display
;
11 public class MiniDesktopImages
{
13 public final Image homeIcon
;
14 public final Image exitIcon
;
16 public final Image terminalIcon
;
17 public final Image browserIcon
;
18 public final Image explorerIcon
;
19 public final Image textEditorIcon
;
21 public final Image folderIcon
;
22 public final Image fileIcon
;
24 public MiniDesktopImages(Display display
) {
25 homeIcon
= loadImage(display
, "nav_home@2x.png");
26 exitIcon
= loadImage(display
, "delete@2x.png");
28 terminalIcon
= loadImage(display
, "console_view@2x.png");
29 browserIcon
= loadImage(display
, "external_browser@2x.png");
30 explorerIcon
= loadImage(display
, "fldr_obj@2x.png");
31 textEditorIcon
= loadImage(display
, "cheatsheet_obj@2x.png");
33 folderIcon
= loadImage(display
, "fldr_obj@2x.png");
34 fileIcon
= loadImage(display
, "file_obj@2x.png");
37 static Image
loadImage(Display display
, String path
) {
38 InputStream stream
= MiniDesktopImages
.class.getResourceAsStream(path
);
40 throw new IllegalArgumentException("Image " + path
+ " not found");
43 image
= new Image(display
, stream
);
44 } catch (SWTException ex
) {
48 } catch (IOException ex
) {