1 /*
   2  * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * This source code is provided to illustrate the usage of a given feature
  28  * or technique and has been deliberately simplified. Additional steps
  29  * required for a production-quality application, such as security checks,
  30  * input validation and proper error handling, might not be present in
  31  * this sample code.
  32  */
  33 
  34 
  35 package com.sun.tools.example.debug.gui;
  36 
  37 import javax.swing.Icon;
  38 import javax.swing.ImageIcon;
  39 
  40 class Icons {
  41 
  42     private static int[]  exec  = {
  43   0xffd8ffe0, 0x00104a46, 0x49460001, 0x01020000
  44 , 0x00000000, 0xffdb0043, 0x00020101, 0x01010102
  45 , 0x01010102, 0x02020202, 0x04030202, 0x02020504
  46 , 0x04030406, 0x05060606, 0x05060606, 0x07090806
  47 , 0x07090706, 0x06080b08, 0x090a0a0a, 0x0a0a0608
  48 , 0x0b0c0b0a, 0x0c090a0a, 0x0affdb00, 0x43010202
  49 , 0x02020202, 0x05030305, 0x0a070607, 0x0a0a0a0a
  50 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
  51 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
  52 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0affc0
  53 , 0x00110800, 0x0c000c03, 0x01220002, 0x11010311
  54 , 0x01ffc400, 0x1f000001, 0x05010101, 0x01010100
  55 , 0x00000000, 0x00000001, 0x02030405, 0x06070809
  56 , 0x0a0bffc4, 0x00b51000, 0x02010303, 0x02040305
  57 , 0x05040400, 0x00017d01, 0x02030004, 0x11051221
  58 , 0x31410613, 0x51610722, 0x71143281, 0x91a10823
  59 , 0x42b1c115, 0x52d1f024, 0x33627282, 0x090a1617
  60 , 0x18191a25, 0x26272829, 0x2a343536, 0x3738393a
  61 , 0x43444546, 0x4748494a, 0x53545556, 0x5758595a
  62 , 0x63646566, 0x6768696a, 0x73747576, 0x7778797a
  63 , 0x83848586, 0x8788898a, 0x92939495, 0x96979899
  64 , 0x9aa2a3a4, 0xa5a6a7a8, 0xa9aab2b3, 0xb4b5b6b7
  65 , 0xb8b9bac2, 0xc3c4c5c6, 0xc7c8c9ca, 0xd2d3d4d5
  66 , 0xd6d7d8d9, 0xdae1e2e3, 0xe4e5e6e7, 0xe8e9eaf1
  67 , 0xf2f3f4f5, 0xf6f7f8f9, 0xfaffc400, 0x1f010003
  68 , 0x01010101, 0x01010101, 0x01000000, 0x00000001
  69 , 0x02030405, 0x06070809, 0x0a0bffc4, 0x00b51100
  70 , 0x02010204, 0x04030407, 0x05040400, 0x01027700
  71 , 0x01020311, 0x04052131, 0x06124151, 0x07617113
  72 , 0x22328108, 0x144291a1, 0xb1c10923, 0x3352f015
  73 , 0x6272d10a, 0x162434e1, 0x25f11718, 0x191a2627
  74 , 0x28292a35, 0x36373839, 0x3a434445, 0x46474849
  75 , 0x4a535455, 0x56575859, 0x5a636465, 0x66676869
  76 , 0x6a737475, 0x76777879, 0x7a828384, 0x85868788
  77 , 0x898a9293, 0x94959697, 0x98999aa2, 0xa3a4a5a6
  78 , 0xa7a8a9aa, 0xb2b3b4b5, 0xb6b7b8b9, 0xbac2c3c4
  79 , 0xc5c6c7c8, 0xc9cad2d3, 0xd4d5d6d7, 0xd8d9dae2
  80 , 0xe3e4e5e6, 0xe7e8e9ea, 0xf2f3f4f5, 0xf6f7f8f9
  81 , 0xfaffda00, 0x0c030100, 0x02110311, 0x003f00fd
  82 , 0xbafda27e, 0x35ea1f03, 0x346f0ef8, 0x86cfc2d3
  83 , 0x6b31ea9e, 0x2ab7d2ee, 0xf4fb38cb, 0x5cc91cb0
  84 , 0xce4790a0, 0xfcd2ef44, 0xc29e1f95, 0xf94b065f
  85 , 0x42a86eb4, 0xed3ef67b, 0x7b9bcb18, 0x6692ce63
  86 , 0x35a492c4, 0x19a090a3, 0x465d09fb, 0xadb1dd72
  87 , 0x39daec3a, 0x13535706, 0x1f0f8ca7, 0x8dad56a5
  88 , 0x5e6a72e5, 0xe485be0b, 0x2b49df77, 0xcceda6ca
  89 , 0xda6ece3a, 0x147150c5, 0xd5a93a97, 0x84b97963
  90 , 0x6f86cbde, 0x77ddf33b, 0x69b2b69b, 0xb3ffd900
  91 
  92     };
  93     private static int[]  blank  = {
  94   0xffd8ffe0, 0x00104a46, 0x49460001, 0x01020000
  95 , 0x00000000, 0xffdb0043, 0x00020101, 0x01010102
  96 , 0x01010102, 0x02020202, 0x04030202, 0x02020504
  97 , 0x04030406, 0x05060606, 0x05060606, 0x07090806
  98 , 0x07090706, 0x06080b08, 0x090a0a0a, 0x0a0a0608
  99 , 0x0b0c0b0a, 0x0c090a0a, 0x0affdb00, 0x43010202
 100 , 0x02020202, 0x05030305, 0x0a070607, 0x0a0a0a0a
 101 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
 102 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
 103 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0affc0
 104 , 0x00110800, 0x0c000c03, 0x01220002, 0x11010311
 105 , 0x01ffc400, 0x1f000001, 0x05010101, 0x01010100
 106 , 0x00000000, 0x00000001, 0x02030405, 0x06070809
 107 , 0x0a0bffc4, 0x00b51000, 0x02010303, 0x02040305
 108 , 0x05040400, 0x00017d01, 0x02030004, 0x11051221
 109 , 0x31410613, 0x51610722, 0x71143281, 0x91a10823
 110 , 0x42b1c115, 0x52d1f024, 0x33627282, 0x090a1617
 111 , 0x18191a25, 0x26272829, 0x2a343536, 0x3738393a
 112 , 0x43444546, 0x4748494a, 0x53545556, 0x5758595a
 113 , 0x63646566, 0x6768696a, 0x73747576, 0x7778797a
 114 , 0x83848586, 0x8788898a, 0x92939495, 0x96979899
 115 , 0x9aa2a3a4, 0xa5a6a7a8, 0xa9aab2b3, 0xb4b5b6b7
 116 , 0xb8b9bac2, 0xc3c4c5c6, 0xc7c8c9ca, 0xd2d3d4d5
 117 , 0xd6d7d8d9, 0xdae1e2e3, 0xe4e5e6e7, 0xe8e9eaf1
 118 , 0xf2f3f4f5, 0xf6f7f8f9, 0xfaffc400, 0x1f010003
 119 , 0x01010101, 0x01010101, 0x01000000, 0x00000001
 120 , 0x02030405, 0x06070809, 0x0a0bffc4, 0x00b51100
 121 , 0x02010204, 0x04030407, 0x05040400, 0x01027700
 122 , 0x01020311, 0x04052131, 0x06124151, 0x07617113
 123 , 0x22328108, 0x144291a1, 0xb1c10923, 0x3352f015
 124 , 0x6272d10a, 0x162434e1, 0x25f11718, 0x191a2627
 125 , 0x28292a35, 0x36373839, 0x3a434445, 0x46474849
 126 , 0x4a535455, 0x56575859, 0x5a636465, 0x66676869
 127 , 0x6a737475, 0x76777879, 0x7a828384, 0x85868788
 128 , 0x898a9293, 0x94959697, 0x98999aa2, 0xa3a4a5a6
 129 , 0xa7a8a9aa, 0xb2b3b4b5, 0xb6b7b8b9, 0xbac2c3c4
 130 , 0xc5c6c7c8, 0xc9cad2d3, 0xd4d5d6d7, 0xd8d9dae2
 131 , 0xe3e4e5e6, 0xe7e8e9ea, 0xf2f3f4f5, 0xf6f7f8f9
 132 , 0xfaffda00, 0x0c030100, 0x02110311, 0x003f00fd
 133 , 0xfca28a28, 0x03ffd900
 134 
 135     };
 136 
 137    private static int[] stopSignWords = {
 138   0xffd8ffe0, 0x00104a46, 0x49460001, 0x01020000
 139 , 0x00000000, 0xffdb0043, 0x00020101, 0x01010102
 140 , 0x01010102, 0x02020202, 0x04030202, 0x02020504
 141 , 0x04030406, 0x05060606, 0x05060606, 0x07090806
 142 , 0x07090706, 0x06080b08, 0x090a0a0a, 0x0a0a0608
 143 , 0x0b0c0b0a, 0x0c090a0a, 0x0affdb00, 0x43010202
 144 , 0x02020202, 0x05030305, 0x0a070607, 0x0a0a0a0a
 145 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
 146 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a
 147 , 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0a0a0a, 0x0a0affc0
 148 , 0x00110800, 0x0c000c03, 0x01220002, 0x11010311
 149 , 0x01ffc400, 0x1f000001, 0x05010101, 0x01010100
 150 , 0x00000000, 0x00000001, 0x02030405, 0x06070809
 151 , 0x0a0bffc4, 0x00b51000, 0x02010303, 0x02040305
 152 , 0x05040400, 0x00017d01, 0x02030004, 0x11051221
 153 , 0x31410613, 0x51610722, 0x71143281, 0x91a10823
 154 , 0x42b1c115, 0x52d1f024, 0x33627282, 0x090a1617
 155 , 0x18191a25, 0x26272829, 0x2a343536, 0x3738393a
 156 , 0x43444546, 0x4748494a, 0x53545556, 0x5758595a
 157 , 0x63646566, 0x6768696a, 0x73747576, 0x7778797a
 158 , 0x83848586, 0x8788898a, 0x92939495, 0x96979899
 159 , 0x9aa2a3a4, 0xa5a6a7a8, 0xa9aab2b3, 0xb4b5b6b7
 160 , 0xb8b9bac2, 0xc3c4c5c6, 0xc7c8c9ca, 0xd2d3d4d5
 161 , 0xd6d7d8d9, 0xdae1e2e3, 0xe4e5e6e7, 0xe8e9eaf1
 162 , 0xf2f3f4f5, 0xf6f7f8f9, 0xfaffc400, 0x1f010003
 163 , 0x01010101, 0x01010101, 0x01000000, 0x00000001
 164 , 0x02030405, 0x06070809, 0x0a0bffc4, 0x00b51100
 165 , 0x02010204, 0x04030407, 0x05040400, 0x01027700
 166 , 0x01020311, 0x04052131, 0x06124151, 0x07617113
 167 , 0x22328108, 0x144291a1, 0xb1c10923, 0x3352f015
 168 , 0x6272d10a, 0x162434e1, 0x25f11718, 0x191a2627
 169 , 0x28292a35, 0x36373839, 0x3a434445, 0x46474849
 170 , 0x4a535455, 0x56575859, 0x5a636465, 0x66676869
 171 , 0x6a737475, 0x76777879, 0x7a828384, 0x85868788
 172 , 0x898a9293, 0x94959697, 0x98999aa2, 0xa3a4a5a6
 173 , 0xa7a8a9aa, 0xb2b3b4b5, 0xb6b7b8b9, 0xbac2c3c4
 174 , 0xc5c6c7c8, 0xc9cad2d3, 0xd4d5d6d7, 0xd8d9dae2
 175 , 0xe3e4e5e6, 0xe7e8e9ea, 0xf2f3f4f5, 0xf6f7f8f9
 176 , 0xfaffda00, 0x0c030100, 0x02110311, 0x003f00f8
 177 , 0xe7e37fc6, 0xff00197f, 0xc142fc65, 0x17ed5bfb
 178 , 0x56db699e, 0x27f14f89, 0xf4cb7b85, 0x5bcd3924
 179 , 0xb5d1ed5d, 0x3cc8b4db, 0x08a4ddf6, 0x6b387cc6
 180 , 0x09182599, 0x99e595e5, 0x9e69a693, 0xbaf0dffc
 181 , 0x1c9dff00, 0x050aff00, 0x82637837, 0x44fd94be
 182 , 0x11e89f0f, 0xfc61e16d, 0x334c5b8f, 0x0f37c45d
 183 , 0x26fef2eb, 0x46b56778, 0xd34db796, 0xd6fadbfd
 184 , 0x0e2f2898, 0xa3903b42, 0xb21891d6, 0x08e08623
 185 , 0xfe0e4ef0, 0xdf837fe0, 0x98dff050, 0xbb2f847f
 186 , 0xb2978274, 0xcd33c2de, 0x30f87f69, 0xe2e6f0f5
 187 , 0xe44ef6ba, 0x35d5c5fe, 0xa16b2dad, 0x8246d1f9
 188 , 0x167fe84b, 0x2a40772c, 0x2d33c717, 0x9702c304
 189 , 0x5fb0dff0, 0x4abff825, 0x5ffc13d7, 0xc55ff04f
 190 , 0x5f845f17, 0x3e2e7ec8, 0xbf0ffe21, 0xf8a7e21f
 191 , 0xc3fd1fc5, 0xde21f10f, 0xc45f0758, 0x6b774b75
 192 , 0xa9584174, 0xf6b6ef75, 0x0b7d9ace, 0x1f304514
 193 , 0x11ed50a8, 0x647f3279, 0x679e5fcf, 0x720cbb37
 194 , 0xc3f1257a, 0x95eb7343, 0xdebabc9d, 0xeef4d1ab
 195 , 0x2b7e1b2d, 0x0fec0f16, 0xb8c7c3cc, 0xdbc15caf
 196 , 0x0795e59e, 0xc710fd97, 0x2cfd9d38, 0xf2f241aa
 197 , 0x9efc64e5, 0x2e67dd7b, 0xdf14acd1, 0xffd90000
 198 
 199 };
 200 
 201     static private byte[] wordsToBytes(int[] wordArray) {
 202         byte[] bytes = new byte[wordArray.length * 4];
 203         int inx = bytes.length;
 204         for (int i = wordArray.length-1; i >= 0; --i) {
 205             int word = wordArray[i];
 206             for (int j = 0; j < 4; ++j) {
 207                 bytes[--inx] = (byte)(word & 0xff);
 208                 word = word >>> 8;
 209             }
 210         }
 211         return bytes;
 212     }
 213 
 214     static Icon stopSignIcon = new ImageIcon(wordsToBytes(stopSignWords));
 215     static Icon blankIcon = new ImageIcon(wordsToBytes(blank));
 216 
 217     static Icon execIcon = new ImageIcon(wordsToBytes(exec));
 218 }