Skip to content

Commit

Permalink
Minor fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
albertus82 committed Jul 21, 2015
1 parent e67b338 commit e3551a6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
26 changes: 17 additions & 9 deletions src/main/java/it/albertus/router/gui/GuiImages.java
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;
}

}
1 change: 0 additions & 1 deletion src/main/java/it/albertus/router/gui/GuiTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public void run() {
catch (IllegalArgumentException iae) {}
catch (SWTException se) {}
}

});
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/it/albertus/router/gui/GuiTray.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static GuiTray getInstance() {
}

private GuiTray() {}

private TrayItem trayItem = null;
private Menu menu = null;

Expand Down Expand Up @@ -101,7 +101,6 @@ public void handleEvent(Event event) {
}
});
}

}
}

Expand Down

0 comments on commit e3551a6

Please sign in to comment.