Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions BalloonUtility/src/org/icpc/tools/balloon/BalloonUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -1085,11 +1085,13 @@ public void showHelp() {
});

Display.setAppName("Balloon Utility");
try {
BufferedImage image = ImageIO.read(BalloonUtility.class.getResourceAsStream("/images/balloonIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
Trace.trace(Trace.INFO, "Couldn't set taskbar icon", e);
if (Taskbar.isTaskbarSupported()) {
try {
BufferedImage image = ImageIO.read(BalloonUtility.class.getResourceAsStream("/images/balloonIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
Trace.trace(Trace.INFO, "Couldn't set taskbar icon", e);
}
}

Display display = new Display();
Expand Down
8 changes: 4 additions & 4 deletions CoachView/src/org/icpc/tools/coachview/CoachView.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public class CoachView extends Panel {

private static boolean lightMode = false;


static {
String[] countries = Locale.getISOCountries();
localeMap = new HashMap<String, Locale>(countries.length);
Expand Down Expand Up @@ -940,7 +939,7 @@ public static void main(String[] args) {
Trace.init("ICPC Coach View", "coachView", args);

String[] displayStr2 = new String[1];
//boolean[] lightMode = new boolean[1];
// boolean[] lightMode = new boolean[1];
ContestSource contestSource = ArgumentParser.parse(args, new OptionParser() {
@Override
public boolean setOption(String option, List<Object> options) throws IllegalArgumentException {
Expand All @@ -949,7 +948,7 @@ public boolean setOption(String option, List<Object> options) throws IllegalArgu
displayStr2[0] = (String) options.get(0);
return true;
} else if ("--light".equals(option)) {
//lightMode[0] = true;
// lightMode[0] = true;
lightMode = true;
return true;
}
Expand Down Expand Up @@ -977,7 +976,8 @@ public void showHelp() {
try {
BufferedImage image = ImageIO.read(CoachView.class.getClassLoader().getResource("images/coachViewIcon.png"));
frame.setIconImage(image);
Taskbar.getTaskbar().setIconImage(image);
if (Taskbar.isTaskbarSupported())
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
// could not set icon
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ public void showHelp() {
View v = new View(url, source.user, source.password);

Display.setAppName("Presentation Admin");
try {
BufferedImage image = ImageIO.read(Admin.class.getResourceAsStream("/images/adminIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
Trace.trace(Trace.INFO, "Couldn't set taskbar icon", e);
if (Taskbar.isTaskbarSupported()) {
try {
BufferedImage image = ImageIO.read(Admin.class.getResourceAsStream("/images/adminIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
Trace.trace(Trace.INFO, "Couldn't set taskbar icon", e);
}
}

final Display display = new Display();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ public PresentationWindowImpl(String title, Rectangle r, Image iconImage) {
this.title = title;

setIconImage(iconImage);
Taskbar.getTaskbar().setIconImage(iconImage);
if (Taskbar.isTaskbarSupported())
Taskbar.getTaskbar().setIconImage(iconImage);

setBounds(r);
setBackground(Color.black);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,14 @@ public static void main(String[] args) {
}

Display.setAppName("Problem Set Editor");
try {
BufferedImage image = ImageIO.read(ProblemSetEditor.class.getResourceAsStream("/images/problemSetIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
// could not set icon
if (Taskbar.isTaskbarSupported()) {
try {
BufferedImage image = ImageIO
.read(ProblemSetEditor.class.getResourceAsStream("/images/problemSetIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
// could not set icon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you want to Trace.

}
}

Display display = new Display();
Expand Down
12 changes: 7 additions & 5 deletions Resolver/src/org/icpc/tools/resolver/awards/AwardUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,13 @@ public static void main(String[] args) {
}

Display.setAppName("Award Utility");
try {
BufferedImage image = ImageIO.read(AwardUI.class.getResourceAsStream("/images/resolverIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
Trace.trace(Trace.ERROR, "Couldn't set taskbar icon");
if (Taskbar.isTaskbarSupported()) {
try {
BufferedImage image = ImageIO.read(AwardUI.class.getResourceAsStream("/images/resolverIcon.png"));
Taskbar.getTaskbar().setIconImage(image);
} catch (Exception e) {
Trace.trace(Trace.ERROR, "Couldn't set taskbar icon");
}
}

Display display = new Display();
Expand Down