View Javadoc
1 package org.neuclear.commons.crypto.passphraseagents.icons; 2 3 import javax.swing.*; 4 import java.net.URL; 5 6 /* 7 * The NeuClear Project and it's libraries are 8 * (c) 2002-2004 Antilles Software Ventures SA 9 * For more information see: http://neuclear.org 10 * 11 * This library is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Lesser General Public 13 * License as published by the Free Software Foundation; either 14 * version 2.1 of the License, or (at your option) any later version. 15 * 16 * This library is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public 22 * License along with this library; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 */ 25 26 /*** 27 * User: pelleb 28 * Date: Apr 21, 2004 29 * Time: 11:12:40 AM 30 */ 31 public class IconTools { 32 33 34 public static Icon getInfo() { 35 if (INFO == null) 36 INFO = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/info.png"); 37 return INFO; 38 } 39 40 public static Icon getInvalid() { 41 if (INVALID == null) 42 INVALID = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/invalid.png"); 43 return INVALID; 44 } 45 46 public static Icon getError() { 47 if (ERROR == null) 48 ERROR = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/error.png"); 49 return ERROR; 50 } 51 52 public static Icon getPersonality() { 53 if (PERSONALITY == null) 54 PERSONALITY = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/personality.png"); 55 return PERSONALITY; 56 } 57 58 public static Icon getPassword() { 59 if (PASSWORD == null) 60 PASSWORD = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/password.png"); 61 return PASSWORD; 62 } 63 64 public static Icon getPersonalities() { 65 if (PERSONALITIES == null) 66 PERSONALITIES = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/personalities.png"); 67 return PERSONALITIES; 68 } 69 70 public static Icon getAddPersonality() { 71 if (PERSONALITY_ADD == null) 72 PERSONALITY_ADD = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/personality_add.png"); 73 return PERSONALITY_ADD; 74 } 75 76 public static Icon getOK() { 77 if (OK == null) 78 OK = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/ok.png"); 79 return OK; 80 } 81 82 public static Icon getCancel() { 83 if (CANCEL == null) 84 CANCEL = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/cancel.png"); 85 return CANCEL; 86 } 87 88 public static Icon getSign() { 89 if (SIGN == null) 90 SIGN = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/sign.png"); 91 return SIGN; 92 } 93 94 public static Icon getSave() { 95 if (SAVE == null) 96 SAVE = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/filesave.png"); 97 return SAVE; 98 } 99 100 public static Icon getSaveAs() { 101 if (SAVEAS == null) 102 SAVEAS = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/filesaveas.png"); 103 return SAVEAS; 104 } 105 106 public static Icon getOpen() { 107 if (OPEN == null) 108 OPEN = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/fileopen.png"); 109 return OPEN; 110 } 111 112 public static Icon getHelp() { 113 if (HELP == null) 114 HELP = loadIcon("org/neuclear/commons/crypto/passphraseagents/icons/help.png"); 115 return HELP; 116 } 117 118 public static ImageIcon getLogo() { 119 if (LOGO == null) 120 LOGO = loadIcon("org/neuclear/commons/crypto/passphraseagents/neuclear.png"); 121 return LOGO; 122 } 123 124 public static ImageIcon loadIcon(String name) { 125 return loadIcon(IconTools.class, name); 126 } 127 128 public static ImageIcon loadIcon(Class cls, String name) { 129 final URL imageurl = cls.getClassLoader().getResource(name); 130 if (imageurl != null) { 131 final ImageIcon icon = new ImageIcon(imageurl); 132 133 return icon; 134 } 135 return null; 136 } 137 138 private static Icon INFO; 139 private static Icon INVALID; 140 private static Icon ERROR; 141 142 private static Icon PERSONALITY; 143 private static Icon PERSONALITIES; 144 private static Icon PERSONALITY_ADD; 145 146 private static Icon PASSWORD; 147 148 private static Icon OK; 149 private static Icon CANCEL; 150 private static Icon SIGN; 151 152 private static Icon SAVE; 153 private static Icon SAVEAS; 154 private static Icon OPEN; 155 156 private static Icon HELP; 157 private static ImageIcon LOGO; 158 159 }

This page was automatically generated by Maven