/** * Add a new {@code SimpleEnumerationType} to the given list using the given {@code name} and * {@code description}. The icon will be set to the Null Icon. * * @param values the list of values to add to. * @param name the short name for the enum. * @param description the description for the enum. */ protected SimpleEnumerationType(Collection<E> values, String name, String description) { super(name, values); this.description = description; this.icon = getNullIcon(); }
/** * Load an icon for this enumeration. {@code loadIconResource} loads the icon found by {@code * a_class.getResource(name)}. * * @param a_class class to use to find icon resource. * @param name name of icon resource, for example, "SOLID.gif" * @return a loaded icon for this enumeration. When no icon can be found the null icon is * returned. * @see #getNullIcon */ protected static Icon loadIconResource(Class a_class, String name) { URL iconURL = a_class.getResource(name); if (iconURL == null) { return getNullIcon(); } return new ImageIcon(iconURL); }
/** * Add a new {@code SimpleEnumerationType} to the given list * using the given {@code name} and {@code description}. * The icon will be set to the Null Icon. * * @param values the list of values to add to. * @param name the short name for the enum. * @param description the description for the enum. */ protected SimpleEnumerationType(Collection values, String name, String description) { super(name, values); this.description = description; this.icon = getNullIcon(); }
/** * Load an icon for this * enumeration. {@code loadIconResource} loads the icon found * by {@code a_class.getResource(name)}. * @param a_class class to use to find icon resource. * @param name name of icon resource, for example, "SOLID.gif" * @return a loaded icon for this enumeration. When no icon can be * found the null icon is returned. * @see #getNullIcon */ protected static Icon loadIconResource(Class a_class, String name) { URL iconURL = a_class.getResource(name); if (iconURL == null) { return getNullIcon(); } return new ImageIcon(iconURL); }