Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class ProtocolIconJabberImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.ProtocolIconJabberImpl
All Implemented Interfaces:
ProtocolIcon

public class ProtocolIconJabberImpl
extends Object
implements ProtocolIcon

Represents the Jabber protocol icon. Implements the ProtocolIcon interface in order to provide a Jabber icon image in two different sizes.

Author:
Yana Stamcheva, Lubomir Marinov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.ProtocolIcon
ICON_SIZE_16x16, ICON_SIZE_32x32, ICON_SIZE_48x48, ICON_SIZE_64x64
 
Constructor Summary
ProtocolIconJabberImpl(String iconPath)
          Creates an instance of this class by passing to it the path, where all protocol icons are placed.
 
Method Summary
 byte[] getConnectingIcon()
          Returns the icon image used to represent the protocol connecting state.
 byte[] getIcon(String iconSize)
          Returns the icon image in the given size.
 String getIconPath(String iconSize)
          Returns a path to the icon with the given size.
static ResourceManagementService getResources()
          Get the ResourceMaangementService registered.
 Iterator<String> getSupportedSizes()
          Implements the ProtocolIcon.getSupportedSizes() method.
 boolean isSizeSupported(String iconSize)
          Returns TRUE if a icon with the given size is supported, FALSE-otherwise.
static byte[] loadIcon(String imagePath)
          Loads an image from a given image path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolIconJabberImpl

public ProtocolIconJabberImpl(String iconPath)
Creates an instance of this class by passing to it the path, where all protocol icons are placed.

Parameters:
iconPath - the protocol icon path
Method Detail

getSupportedSizes

public Iterator<String> getSupportedSizes()
Implements the ProtocolIcon.getSupportedSizes() method. Returns an iterator to a set containing the supported icon sizes.

Specified by:
getSupportedSizes in interface ProtocolIcon
Returns:
an iterator to a set containing the supported icon sizes

isSizeSupported

public boolean isSizeSupported(String iconSize)
Returns TRUE if a icon with the given size is supported, FALSE-otherwise.

Specified by:
isSizeSupported in interface ProtocolIcon
Parameters:
iconSize - the size of the protocol icon; one of the ICON_SIZE_XXX constants
Returns:
TRUE if a icon with the given size is supported, FALSE-otherwise.

getIcon

public byte[] getIcon(String iconSize)
Returns the icon image in the given size.

Specified by:
getIcon in interface ProtocolIcon
Parameters:
iconSize - the icon size; one of ICON_SIZE_XXX constants
Returns:
the protocol icon image in the desired size

getIconPath

public String getIconPath(String iconSize)
Returns a path to the icon with the given size.

Specified by:
getIconPath in interface ProtocolIcon
Parameters:
iconSize - the size of the icon we're looking for
Returns:
the path to the icon with the given size

getConnectingIcon

public byte[] getConnectingIcon()
Returns the icon image used to represent the protocol connecting state.

Specified by:
getConnectingIcon in interface ProtocolIcon
Returns:
the icon image used to represent the protocol connecting state

loadIcon

public static byte[] loadIcon(String imagePath)
Loads an image from a given image path.

Parameters:
imagePath - The identifier of the image.
Returns:
The image for the given identifier.

getResources

public static ResourceManagementService getResources()
Get the ResourceMaangementService registered.

Returns:
ResourceManagementService registered

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.