From a4993bcd399b3c70295110ee5af3d8cec8d20d0e Mon Sep 17 00:00:00 2001 From: hdaniels Date: Thu, 23 Jun 2005 10:52:38 +0000 Subject: [PATCH] added an application icon for gfeditor. But the icon itself is worth improvement --- .../de/uka/ilkd/key/ocl/gf/GFEditor2.java | 21 +++++++++++++----- src/JavaGUI2/gf-logo-64.gif | Bin 0 -> 1513 bytes src/Makefile | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 src/JavaGUI2/gf-logo-64.gif diff --git a/src/JavaGUI2/de/uka/ilkd/key/ocl/gf/GFEditor2.java b/src/JavaGUI2/de/uka/ilkd/key/ocl/gf/GFEditor2.java index 634f2c08b..a43165d5f 100644 --- a/src/JavaGUI2/de/uka/ilkd/key/ocl/gf/GFEditor2.java +++ b/src/JavaGUI2/de/uka/ilkd/key/ocl/gf/GFEditor2.java @@ -466,7 +466,14 @@ KeyListener, FocusListener { public GFEditor2(String gfcmd, boolean isHtml, URL baseURL) { this.callback = null; this.commandPath = gfcmd; - initializeGUI(baseURL, isHtml); + Image icon = null; + try { + final URL iconURL = ClassLoader.getSystemResource("gf-logo-64.gif"); + icon = Toolkit.getDefaultToolkit().getImage(iconURL); + } catch (NullPointerException npe) { + logger.info("gf-logo-64.gif could not be found.\n" + npe.getLocalizedMessage()); + } + initializeGUI(baseURL, isHtml, icon); initializeGF(gfcmd, null); //readAndDisplay(); } @@ -488,7 +495,7 @@ KeyListener, FocusListener { Utils.tickProgress(pm, 5220, "Loading grammars"); initializeGF(gfcmd, pm); Utils.tickProgress(pm, 9350, "Initializing GUI"); - initializeGUI(null, true); + initializeGUI(null, true, null); // send correct term (syntax tree) //The initial GF constraint has until now always been @@ -561,16 +568,20 @@ KeyListener, FocusListener { /** * reliefs the constructor from setting up the GUI stuff * @param baseURL the base URL for relative links in the HTML view - * @param showHtml TODO + * @param showHtml if the linearization area for HTML should be active + * instead of the pure text version + * @param icon The icon in the title bar of the main window. + * For KeY-usage, no icon is given and the Swing default is chosen + * instead. */ - private void initializeGUI(URL baseURL, boolean showHtml) { + private void initializeGUI(URL baseURL, boolean showHtml, Image icon) { this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { endProgram(); } }); - + setIconImage(icon); this.readDialog = new ReadDialog(this); //Add listener to components that can bring up popup menus. diff --git a/src/JavaGUI2/gf-logo-64.gif b/src/JavaGUI2/gf-logo-64.gif new file mode 100644 index 0000000000000000000000000000000000000000..041cca41e878163491de53e2b84eedded3895b23 GIT binary patch literal 1513 zcmZ?wbh9u|bYO5`c;3wLgMr}(8`}>Kjvt(yKe)JlaC86Q;rYSO|3g6FhoIn3Vd0-5 zB0oh%e~O9yl#uu-E&WqY?x&*SPbHN zO-z28n*KC1`(78w>kqKPM_25w`YZzga1ybgb!K2|S=ovs`nolLSdo7OR2e0b(wYr0iK#N;VF zOfuDc#&?>T8E4K;6??&_uXmD?`A;MC&=%Bc+w3c7%6sT-b3yZ0^R2TVfn5Hq2>N z^P1MeWpzX#xv%}`g2N*Ge=;7NrI{zCOwGA3eb>gMnUOmc(;Tg~7%WfGoe?%chPmM3H9p}z2`?6Q zsQqG+;4Cz3kYQI$Y?MoXt8hqQM%t>E%bb@qPLLC;shpsoeup7C#HdO11h4vq(hE`- zI6WA{Rz-SFWJu_%XD4U4QM*U4}wvGqcn#!h4