-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e67b338
commit e3551a6
Showing
3 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
package it.albertus.router.gui; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
import org.eclipse.swt.graphics.Image; | ||
import org.eclipse.swt.graphics.ImageData; | ||
import org.eclipse.swt.graphics.ImageLoader; | ||
import org.eclipse.swt.widgets.Display; | ||
|
||
public class GuiImages { | ||
|
||
public static final Image[] ICONS; | ||
|
||
static { | ||
ImageLoader loader = new ImageLoader(); | ||
ImageData[] images = loader.load(GuiImages.class.getResourceAsStream("router.ico")); | ||
ICONS = new Image[images.length]; | ||
public static final Image[] ICONS = initIcons(); | ||
|
||
private static Image[] initIcons() { | ||
InputStream is = GuiImages.class.getResourceAsStream("router.ico"); | ||
ImageData[] images = new ImageLoader().load(is); | ||
try { | ||
is.close(); | ||
} | ||
catch (IOException ioe) {} | ||
Image[] icons = new Image[images.length]; | ||
int i = 0; | ||
for(ImageData id : images) { | ||
ICONS[i++] = new Image(Display.getCurrent(), id); | ||
for (ImageData id : images) { | ||
icons[i++] = new Image(Display.getCurrent(), id); | ||
} | ||
return icons; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,6 @@ public void run() { | |
catch (IllegalArgumentException iae) {} | ||
catch (SWTException se) {} | ||
} | ||
|
||
}); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters