diff --git a/src/net/java/sip/communicator/impl/gui/utils/ColorProperties.java b/src/net/java/sip/communicator/impl/gui/utils/ColorProperties.java new file mode 100644 index 000000000..6506f78c0 --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/utils/ColorProperties.java @@ -0,0 +1,59 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.impl.gui.utils; + +import java.util.*; + +import net.java.sip.communicator.util.*; + +/** + * Accesses the color resources saved in the colorResources.properties file. + * + * @author Yana Stamcheva + */ +public class ColorProperties +{ + /** + * Logger for this class. + */ + private static Logger log = Logger.getLogger(ColorProperties.class); + + /** + * Name of the bundle where we will search for color resources. + */ + private static final String BUNDLE_NAME + = "resources.colors.colorResources"; + + /** + * Bundle which handle access to localized resources. + */ + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle + .getBundle( BUNDLE_NAME, + Locale.getDefault(), + ColorProperties.class.getClassLoader()); + + /** + * Returns an int RGB color corresponding to the given key. + * + * @param key The key of the string. + * + * @return An internationalized string corresponding to the given key. + */ + public static int getColor(String key) + { + try + { + return Integer.parseInt(RESOURCE_BUNDLE.getString(key), 16); + } + catch (MissingResourceException e) + { + log.error("Missing color resource.", e); + + return 0xFFFFFF; + } + } +} diff --git a/src/net/java/sip/communicator/impl/gui/utils/LookAndFeelProperties.java b/src/net/java/sip/communicator/impl/gui/utils/LookAndFeelProperties.java new file mode 100644 index 000000000..c5a90167c --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/utils/LookAndFeelProperties.java @@ -0,0 +1,57 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.impl.gui.utils; + +import java.util.*; + +import net.java.sip.communicator.util.*; + +/** + * Accesses all Look&Feel properties saved in the lookandfeel.properties file. + * + * @author Yana Stamcheva + */ +public class LookAndFeelProperties +{ + /** + * Logger for this class. + */ + private static Logger log = Logger.getLogger(LookAndFeelProperties.class); + + /** + * Name of the bundle where we will search for look and feel resources. + */ + private static final String BUNDLE_NAME + = "resources.lookandfeel"; + + /** + * Bundle which handle access to look and feel resources. + */ + private static final ResourceBundle PROPERTIES_BUNDLE = ResourceBundle + .getBundle( BUNDLE_NAME); + + /** + * Returns the look and feel property corresponding to the given key. + * + * @param key The key of the string. + * + * @return the look and feel property corresponding to the given key + */ + public static String getProperty(String key) + { + try + { + return PROPERTIES_BUNDLE.getString(key); + } + catch (MissingResourceException e) + { + log.error("Missing property.", e); + + return ""; + } + } +} \ No newline at end of file diff --git a/src/net/java/sip/communicator/impl/gui/utils/SizeProperties.java b/src/net/java/sip/communicator/impl/gui/utils/SizeProperties.java new file mode 100644 index 000000000..491ec72f6 --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/utils/SizeProperties.java @@ -0,0 +1,60 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ +package net.java.sip.communicator.impl.gui.utils; + +import java.util.*; + +import net.java.sip.communicator.util.*; + +/** + * Manages the access to the size properties contained in the size.properties + * file in the resource folder. + * + * @author Yana Stamcheva + */ +public class SizeProperties +{ + /** + * Logger for this class. + */ + private static Logger log = Logger.getLogger(SizeProperties.class); + + /** + * Name of the bundle where we will search for size properties. + */ + private static final String BUNDLE_NAME + = "resources.size.size"; + + /** + * Bundle which handles access to the size properties. + */ + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle + .getBundle( BUNDLE_NAME, + Locale.getDefault(), + SizeProperties.class.getClassLoader()); + + /** + * Returns the size corresponding to the given key. + * + * @param key The key of the string. + * + * @return the size corresponding to the given key + */ + public static int getSize(String key) + { + try + { + return Integer.parseInt(RESOURCE_BUNDLE.getString(key)); + } + catch (MissingResourceException e) + { + log.error("Missing size resource.", e); + + return 0; + } + } +} diff --git a/src/net/java/sip/communicator/impl/gui/utils/SoundProperties.java b/src/net/java/sip/communicator/impl/gui/utils/SoundProperties.java new file mode 100644 index 000000000..073f35592 --- /dev/null +++ b/src/net/java/sip/communicator/impl/gui/utils/SoundProperties.java @@ -0,0 +1,75 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + +package net.java.sip.communicator.impl.gui.utils; + +import java.util.*; + +/** + * Manages the access to the properties file containing all sounds paths. + * + * @author Yana Stamcheva + */ +public class SoundProperties +{ + public static String INCOMING_MESSAGE + = "resources/sounds/incomingMessage.wav"; + + public static String OUTGOING_CALL + = "resources/sounds/ring.wav"; + + public static String INCOMING_CALL + = "resources/sounds/incomingCall.wav"; + + public static String DIAL_ZERO + = "resources/sounds/one_1.wav"; + + public static String DIAL_ONE + = "resources/sounds/one_1.wav"; + + public static String DIAL_TWO + = "resources/sounds/two_2.wav"; + + public static String DIAL_THREE + = "resources/sounds/three_3.wav"; + + public static String DIAL_FOUR + = "resources/sounds/four_4.wav"; + + public static String DIAL_FIVE + = "resources/sounds/five_5.wav"; + + public static String DIAL_SIX + = "resources/sounds/six_6.wav"; + + public static String DIAL_SEVEN + = "resources/sounds/seven_7.wav"; + + public static String DIAL_EIGHT + = "resources/sounds/eight_8.wav"; + + public static String DIAL_NINE + = "resources/sounds/nine_9.wav"; + + public static String DIAL_DIEZ + = "resources/sounds/one_1.wav"; + + public static String DIAL_STAR + = "resources/sounds/one_1.wav"; + + public static String BUSY + = "resources/sounds/busy.wav"; + + private static final String BUNDLE_NAME + = "net.java.sip.communicator.impl.gui.utils.sounds"; + + private static final ResourceBundle RESOURCE_BUNDLE + = ResourceBundle.getBundle(BUNDLE_NAME); + + private SoundProperties() { + } +}