/** * Returns the string representation of the color corresponding to the given key. * * @param key The key of the color in the colors properties file. * @return the string representation of the color corresponding to the given key. */ public String getColorString(String key) { String res = getColorResources().get(key); if (res == null) { logger.error("Missing color resource for key: " + key); return "0xFFFFFF"; } else return res; }
/** * Returns the int representation of the color corresponding to the given key. * * @param key The key of the color in the colors properties file. * @return the int representation of the color corresponding to the given key. */ public int getColor(String key) { String res = getColorResources().get(key); if (res == null) { logger.error("Missing color resource for key: " + key); return 0xFFFFFF; } else return Integer.parseInt(res, 16); }
/** * Loads an image from a given image identifier. * * @param imageID The identifier of the image. * @return The image for the given identifier. */ @Override public byte[] getImageInBytes(String imageID) { InputStream in = getImageInputStream(imageID); if (in == null) return null; byte[] image = null; try { image = new byte[in.available()]; in.read(image); } catch (IOException e) { logger.error("Failed to load image:" + imageID, e); } return image; }