public class ResourceManagementServiceImpl extends AbstractResourcesService
Constructor and Description |
---|
ResourceManagementServiceImpl()
Initializes already registered default resource packs.
|
Modifier and Type | Method and Description |
---|---|
int |
getColor(java.lang.String key)
Returns the int representation of the color corresponding to the
given key.
|
java.lang.String |
getColorString(java.lang.String key)
Returns the string representation of the color corresponding to the
given key.
|
javax.swing.ImageIcon |
getImage(java.lang.String imageID)
Loads an image from a given image identifier.
|
byte[] |
getImageInBytes(java.lang.String imageID)
Loads an image from a given image identifier.
|
java.io.InputStream |
getImageInputStream(java.lang.String streamKey)
Returns the InputStream of the image corresponding to the given
key.
|
java.io.InputStream |
getImageInputStreamForPath(java.lang.String path)
Returns the InputStream of the image corresponding to the given
path.
|
java.net.URL |
getImageURL(java.lang.String urlKey)
Returns the URL of the image corresponding to the given key.
|
java.net.URL |
getImageURLForPath(java.lang.String path)
Returns the URL of the image corresponding to the given path.
|
java.lang.String |
getSettingsString(java.lang.String key)
Gets the specified setting from the config service if present, otherwise
from the embedded resources (resources/config/defaults.properties).
|
java.net.URL |
getSoundURL(java.lang.String urlKey)
Returns the URL of the sound corresponding to the given
property key.
|
java.net.URL |
getSoundURLForPath(java.lang.String path)
Returns the URL of the sound corresponding to the given path.
|
protected void |
onSkinPackChanged()
Repaints the whole UI when a skin pack has changed.
|
java.io.File |
prepareSkinBundleFromZip(java.io.File zipFile)
Builds a new skin bundle from the zip file content.
|
void |
serviceChanged(org.osgi.framework.ServiceEvent event)
Gets a reference to the UIService when this one is registered.
|
doGetI18String, getAvailableLocales, getColorResources, getDefaultResourcePack, getI18nMnemonic, getI18nMnemonic, getI18NString, getI18NString, getI18NString, getI18NString, getImagePack, getImagePath, getResources, getSettingsInputStream, getSettingsInputStream, getSettingsInt, getSettingsURL, getSkinPack, getSoundPack, getSoundPath
ResourceManagementServiceImpl()
public void serviceChanged(org.osgi.framework.ServiceEvent event)
serviceChanged
in interface org.osgi.framework.ServiceListener
serviceChanged
in class AbstractResourcesService
event
- the ServiceEvent that has notified usprotected void onSkinPackChanged()
onSkinPackChanged
in class AbstractResourcesService
public int getColor(java.lang.String key)
key
- The key of the color in the colors properties file.public java.lang.String getColorString(java.lang.String key)
key
- The key of the color in the colors properties file.public java.io.InputStream getImageInputStreamForPath(java.lang.String path)
path
- The path to the image file.public java.io.InputStream getImageInputStream(java.lang.String streamKey)
streamKey
- The identifier of the image in the resource properties
file.public java.net.URL getImageURL(java.lang.String urlKey)
urlKey
- The identifier of the image in the resource properties file.public java.net.URL getImageURLForPath(java.lang.String path)
path
- The path to the given image file.public java.net.URL getSoundURL(java.lang.String urlKey)
public java.net.URL getSoundURLForPath(java.lang.String path)
path
- the path, for which we're looking for a sound URLpublic byte[] getImageInBytes(java.lang.String imageID)
getImageInBytes
in interface org.jitsi.service.resources.ResourceManagementService
getImageInBytes
in class AbstractResourcesService
imageID
- The identifier of the image.public javax.swing.ImageIcon getImage(java.lang.String imageID)
getImage
in interface org.jitsi.service.resources.ResourceManagementService
getImage
in class AbstractResourcesService
imageID
- The identifier of the image.public java.io.File prepareSkinBundleFromZip(java.io.File zipFile) throws java.lang.Exception
zipFile
- Zip file with skin information.java.lang.Exception
- When something goes wrong.public java.lang.String getSettingsString(java.lang.String key)
getSettingsString
in interface org.jitsi.service.resources.ResourceManagementService
getSettingsString
in class AbstractResourcesService
key
- The setting to lookup.null
if not found.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.